Skip to content

Commit

Permalink
Beta mode fixes (#59)
Browse files Browse the repository at this point in the history
* beta fix

* profile default selected scope
  • Loading branch information
rohanharikr authored Aug 15, 2024
1 parent 34d6b29 commit 2e325c4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@
//default values, also binds to user input
let states = {
selected_authorization_server: 'https://wallet.hello.coop/authorize',
custom_authorization_servers: [],
custom_authorization_servers: [betaAuthzServer],
// update_scope: false,
scopes: ['openid'],
scopes: ['openid', 'profile'],
custom_scopes: [],
...defaultQueryParamStates,
invite_query_param_values: {
Expand Down Expand Up @@ -311,15 +311,6 @@
async function processFragmentOrQuery() {
if (!window.location.hash && !window.location.search) return;
let protocolParams;
if (window.location.hash) {
protocolParams = new URLSearchParams(window.location.hash.substring(1));
result.authorize = window.location.hash;
} else if (window.location.search) {
protocolParams = new URLSearchParams(window.location.search);
result.authorize = window.location.search;
}
const isBetaMode = window.location.hash.includes('beta');
if (isBetaMode) {
states.custom_authorization_servers = [
Expand All @@ -329,6 +320,15 @@
states.dropdowns.authzServer = true;
}
let protocolParams;
if (window.location.hash && !isBetaMode) {
protocolParams = new URLSearchParams(window.location.hash.substring(1));
result.authorize = window.location.hash;
} else if (window.location.search) {
protocolParams = new URLSearchParams(window.location.search);
result.authorize = window.location.search;
}
cleanURL();
const id_token = protocolParams.get('id_token');
Expand Down

0 comments on commit 2e325c4

Please sign in to comment.