-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to use dummy user when Auth0 is enabled
- Loading branch information
1 parent
393fe3b
commit 523b3c1
Showing
7 changed files
with
79 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { on } from '@ember/modifier'; | ||
import Service, { inject as service } from '@ember/service'; | ||
import Component from '@glimmer/component'; | ||
|
||
export default class DevLogin extends Component<IArgs> { | ||
@service('router') | ||
router!: any; | ||
|
||
enableDevMode = () => { | ||
sessionStorage.setItem('no-auth', 'true'); | ||
this.router.transitionTo('/landscapes'); | ||
}; | ||
|
||
<template> | ||
<div class='d-flex justify-content-center'> | ||
<button type='submit' {{on 'click' this.enableDevMode}}> | ||
Sign in for Development | ||
</button> | ||
</div> | ||
</template> | ||
} |
This file contains 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 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 |
---|---|---|
@@ -1,3 +1,18 @@ | ||
import Route from '@ember/routing/route'; | ||
import { inject as service } from '@ember/service'; | ||
import Router from '@ember/routing/router'; | ||
|
||
export default class Callback extends Route {} | ||
/** | ||
* TODO | ||
* | ||
* @class Callback-Route | ||
* @extends Ember.Route | ||
*/ | ||
export default class Callback extends Route { | ||
@service | ||
router!: Router; | ||
|
||
async afterModel() { | ||
this.router.transitionTo('landscapes'); | ||
} | ||
} |
This file contains 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 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
<div id='auth0-login-container'></div> | ||
<div id='auth0-login-container'></div> | ||
<PageSetup::DevLogin /> |
This file contains 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 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 |
---|---|---|
@@ -1,16 +1,6 @@ | ||
import { module, test } from 'qunit'; | ||
import { visit, currentURL } from '@ember/test-helpers'; | ||
import { setupApplicationTest } from 'ember-qunit'; | ||
// import { visit, currentURL } from '@ember/test-helpers'; | ||
// import { setupApplicationTest } from 'ember-qunit'; | ||
|
||
module('Acceptance | index', (hooks) => { | ||
setupApplicationTest(hooks); | ||
|
||
test('visiting /index', async (assert) => { | ||
await visit('/index'); | ||
assert.equal( | ||
currentURL(), | ||
'/login', | ||
'Index route replaces current URL with login route.' | ||
); | ||
}); | ||
}); |