forked from artisan-tattoo/assistant-frontend
Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
workin towards auth
- Loading branch information
1 parent
dee515c
commit 1c51ef4e9db8e03883da619d7c7cdd9694b9c7a0
Showing
7 changed files
with
45 additions
and
6 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,12 @@ | ||
| import Ember from 'ember'; | ||
|
|
||
| export default Ember.Controller.extend({ | ||
| actions: { | ||
| authenticate: function() { | ||
| var credentials = this.getProperties('identification', 'password'), | ||
| authenticator = 'simple-auth-authenticator:jwt'; | ||
|
|
||
| this.get('session').authenticate(authenticator, credentials); | ||
| } | ||
| } | ||
| }); |
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 |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import Ember from 'ember'; | ||
| import ApplicationRouteMixin from 'simple-auth/mixins/application-route-mixin'; | ||
|
|
||
| export default Ember.Route.extend(ApplicationRouteMixin, { | ||
| actions: { | ||
| invalidateSession: function() { | ||
| this.get('session').invalidate(); | ||
| } | ||
| } | ||
| }); |
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,4 @@ | ||
| import Ember from 'ember'; | ||
| import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin'; | ||
|
|
||
| export default Ember.Route.extend(AuthenticatedRouteMixin); |
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
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
You could try putting a full url here to have it hit your server. Be sure to checkout https://github.com/simplabs/ember-simple-auth#cross-origin-authorization to make sure you whitelist your backend.