Files
cypress/packages/server/lib/util/machine_id.js
T
Zach Bloomquist f89a8236a8 Do auth in the user's browser, do auth through the dashboard, s… (#3616)
* desktop-gui: use authBegin api

* server: add auth lib for in-browser auth

* server: unneeded

* server: send proper cors header, actually receive authinfo

* desktop-gui: DASHBOARD_LOGIN

* server: send both auth flows through dashboard login

* server, desktop-gui: exchange code for token, move logic out of desktop gui, cache auth urls

* server: cleanup

* server: refresh token [wip]

* server: cleanup

* server: focus main window on login

* server: focus cypress after login

* server: fix

* server: use id_token so Google Login works, fixes to fallback electron auth flow

* desktop-gui: "Log In with GitHub" -> "Log In to Dashboard"

* server: work without electron

* server: what a bizarre function signature, but ok

* server: unit test for new auth.js

* driver, server: cleanup

* server: use redirects instead of XHR

* server: update api spec

* add some tests for token refreshin

* desktop-gui: update tests, cleanup

* unit tests

* add user unit tests

* server: rely on dashboard to set us up with access_token, user profile, etc

* server: cleanup

* redirect errors too

* server: don't worry about refresh tokens in TR

* guard against null server

* don't regenerate state

* fix auth unit test

* fall back to electron auth if native auth never opens

* break out MarkdownRenderer component

* warn if browser not opened, offer copyable url

* remove electron fallback and all login window handling

* update tests

* send more feedback when authing

* add success message when logging in

* update tests to expect continue button, warnings

* use :contains

* send machineId, version, platform, arch with login

* createSignout -> createLogout, get logoutUrl from /auth v2 endpoint

* Change version queryParam to cypressVersion, keep platform as platform, don't bother sending arch

* Change " Opening browser..." button to display " Browser failed to open"

* "You are now logged in to the Cypress Dashboard as Zach Bloomquist." -> "You are now logged in as Zach Bloomquist."

* POST /signout -> GET /logout

* make fallback URL click-to-select

* add tests for edge cases in browser launching

* cleanup

* logoutUrl -> dashboardLogoutUrl

* getLogout -> postLogout

* getLogout -> postLogout

* send machineId with postLogout
2019-07-09 09:39:10 -04:00

13 lines
164 B
JavaScript

const nmi = require('node-machine-id')
function machineId () {
return nmi.machineId()
.catch(() => {
return null
})
}
module.exports = {
machineId,
}