-
-
Notifications
You must be signed in to change notification settings - Fork 205
sign in to desktop app #2300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
sign in to desktop app #2300
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
64576e3
chore: jsdocs for trust_ring
abose 443877c
chore: login to phoenix code wiring in initial
abose c17863a
chore: login to phoenix code getAppAuth working
abose a6a6bba
chore: login working initial
abose 1741a67
chore: signout working
abose 949c4bc
feat: multi window signin signout working
abose 59ed7c1
chore: support url is now single
abose 88fb580
refactor: login popup strings
abose 589d554
chore: fill in correct profile details
abose 01208af
chore: use shadow dom to hide sensitive email/name from extensions
abose 9487a58
feat: auto sign in localhost
abose 7b44c0f
fix: build failure due to define( rewrite
abose 71cd8a3
fix: desktop test runner fails
abose File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -139,6 +139,7 @@ define(function (require, exports, module) { | |
| require("widgets/InlineMenu"); | ||
| require("thirdparty/tinycolor"); | ||
| require("utils/LocalizationUtils"); | ||
| require("services/login"); | ||
|
|
||
| // DEPRECATED: In future we want to remove the global CodeMirror, but for now we | ||
| // expose our required CodeMirror globally so as to avoid breaking extensions in the | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,9 +3,10 @@ | |
| "app_title": "Phoenix Code", | ||
| "app_name_about": "Phoenix Code", | ||
| "about_icon": "styles/images/phoenix-icon.svg", | ||
| "account_url": "https://account.phcode.io/", | ||
| "how_to_use_url": "https://github.com/adobe/brackets/wiki/How-to-Use-Brackets", | ||
| "docs_url": "https://docs.phcode.dev/", | ||
| "support_url": "https://github.com/phcode-dev/phoenix/discussions", | ||
| "support_url": "https://account.phcode.io/?returnUrl=https%3A%2F%2Faccount.phcode.io%2F%23support", | ||
| "suggest_feature_url": "https://github.com/phcode-dev/phoenix/discussions/categories/ideas", | ||
| "report_issue_url": "https://github.com/phcode-dev/phoenix/issues/new/choose", | ||
| "get_involved_url": "https://github.com/phcode-dev/phoenix/discussions/77", | ||
|
|
@@ -59,4 +60,4 @@ | |
| "url": "https://github.com/phcode-dev/phoenix/blob/master/LICENSE" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,6 @@ | |
| * | ||
| */ | ||
|
|
||
| /*global Phoenix*/ | ||
| /*eslint no-console: 0*/ | ||
| /*eslint strict: ["error", "global"]*/ | ||
| /* jshint ignore:start */ | ||
|
|
@@ -32,26 +31,10 @@ define(function (require, exports, module) { | |
| Strings = require("strings"), | ||
| Dialogs = require("widgets/Dialogs"), | ||
| NotificationUI = require("widgets/NotificationUI"), | ||
| DefaultDialogs = require("widgets/DefaultDialogs"), | ||
| ProfileMenu = require("./profile-menu"); | ||
| DefaultDialogs = require("widgets/DefaultDialogs"); | ||
|
|
||
| const PERSIST_STORAGE_DIALOG_DELAY_SECS = 60000; | ||
| let $icon; | ||
|
|
||
| function _addToolbarIcon() { | ||
| const helpButtonID = "user-profile-button"; | ||
| $icon = $("<a>") | ||
| .attr({ | ||
| id: helpButtonID, | ||
| href: "#", | ||
| class: "user", | ||
| title: Strings.CMD_USER_PROFILE | ||
| }) | ||
| .appendTo($("#main-toolbar .bottom-buttons")); | ||
| $icon.on('click', ()=>{ | ||
| ProfileMenu.init(); | ||
| }); | ||
| } | ||
| function _showUnSupportedBrowserDialogue() { | ||
| if(Phoenix.browser.isMobile || Phoenix.browser.isTablet){ | ||
| Dialogs.showModalDialog( | ||
|
|
@@ -109,7 +92,6 @@ define(function (require, exports, module) { | |
| if(Phoenix.isSpecRunnerWindow){ | ||
| return; | ||
| } | ||
| _addToolbarIcon(); | ||
| serverSync.init(); | ||
| defaultProjects.init(); | ||
| newProject.init(); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -629,7 +629,7 @@ define({ | |
| "CMD_AUTO_UPDATE": "Auto Update", | ||
| "CMD_HOW_TO_USE_BRACKETS": "How to Use {APP_NAME}", | ||
| "CMD_SUPPORT": "{APP_NAME} Support", | ||
| "CMD_USER_PROFILE": "User Profile", | ||
| "CMD_USER_PROFILE": "{APP_NAME} Account", | ||
| "CMD_DOCS": "Help, Getting Started", | ||
| "CMD_SUGGEST": "Suggest a Feature", | ||
| "CMD_REPORT_ISSUE": "Report Issue", | ||
|
|
@@ -1564,5 +1564,27 @@ define({ | |
| "GIT_TOAST_MESSAGE": "Click the Git panel icon to manage your repository. Easily commit, push, pull, and view your project history—all in one place.<br><a href='https://docs.phcode.dev/docs/Features/git'>Learn more about the Git panel →</a>", | ||
|
|
||
| // surveys | ||
| "SURVEY_TITLE_VOTE_FOR_FEATURES_YOU_WANT": "Vote for the features you want to see next!" | ||
| "SURVEY_TITLE_VOTE_FOR_FEATURES_YOU_WANT": "Vote for the features you want to see next!", | ||
|
|
||
| // login | ||
| "SIGNED_OUT": "You have been signed out.", | ||
| "SIGNED_OUT_MESSAGE": "You have been signed out of your {APP_NAME} account. Please sign in again to continue.", | ||
| "SIGNED_OUT_MESSAGE_FRIENDLY": "Thank you for using {APP_NAME}. See you soon!", | ||
| "SIGNED_IN_OFFLINE_TITLE": "Offline - Cannot Sign In", | ||
| "SIGNED_IN_OFFLINE_MESSAGE": "Please connect to the internet to sign in to {APP_NAME}.", | ||
| "SIGNED_IN_FAILED_TITLE": "Cannot Sign In", | ||
| "SIGNED_IN_FAILED_MESSAGE": "Something went wrong while trying to sign in. Please try again.", | ||
| "SIGNED_OUT_FAILED_TITLE": "Failed to Sign Out", | ||
| "SIGNED_OUT_FAILED_MESSAGE": "Something went wrong while trying to sign out. Please try again.", | ||
| "VALIDATION_CODE_TITLE": "Sign In Verification Code", | ||
| "VALIDATION_CODE_MESSAGE": "Please use this Verification code to sign in to your {APP_NAME} account:", | ||
| "COPY_VALIDATION_CODE": "Copy Code", | ||
| "VALIDATION_CODE_COPIED": "Copied", | ||
| "OPEN_SIGN_IN_URL": "Open Sign In Page", | ||
| "PROFILE_POP_TITLE": "{APP_NAME} Account", | ||
| "PROFILE_SIGN_IN": "Sign in to your account", | ||
| "CONTACT_SUPPORT": "Contact support", | ||
| "SIGN_OUT": "Sign out", | ||
| "ACCOUNT_DETAILS": "Account Details", | ||
| "AI_QUOTA_USED": "AI quota used" | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,9 +18,13 @@ | |
| * | ||
| */ | ||
|
|
||
| /*global Phoenix, fs, logger*/ | ||
| /*global fs, logger*/ | ||
|
|
||
| function nodeLoader() { | ||
| const KernalModeTrust = window.KernalModeTrust; | ||
| if(!KernalModeTrust){ | ||
| throw new Error("KernalModeTrust is not defined. Cannot boot nodeLoader without trust ring"); | ||
| } | ||
| const nodeLoadstartTime = Date.now(); | ||
| const phcodeExecHandlerMap = {}; | ||
| const nodeConnectorIDMap = {}; | ||
|
|
@@ -721,6 +725,7 @@ function nodeLoader() { | |
| fs.setNodeWSEndpoint(message.phoenixFSURL); | ||
| fs.forceUseNodeWSEndpoint(true); | ||
| setNodeWSEndpoint(message.phoenixNodeURL); | ||
| KernalModeTrust.localAutoAuthURL = message.autoAuthURL; | ||
| window.isNodeReady = true; | ||
| resolve(message); | ||
| // node is designed such that it is not required at boot time to lower startup time. | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check failure
Code scanning / CodeQL
CORS misconfiguration for credentials transfer
Copilot Autofix
AI about 1 year ago
To fix the issue, the
Access-Control-Allow-Originheader must only be set to trusted origins. This can be achieved by validating theoriginheader against a whitelist of allowed origins before setting it. If theoriginis not in the whitelist, the header should not be set, and the request should be rejected.Steps to fix:
originheader against the whitelist before setting theAccess-Control-Allow-Originheader.OPTIONSpreflight requests.Required changes:
autoAuthfunction to validate theoriginheader against the whitelist before setting theAccess-Control-Allow-Originheader.