This repository has been archived by the owner on Aug 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable redirection to previous page after login
Two different strategies are adopted, one for when the user authenticates locally and the other through providers. When authenticating locally, the signin function in the client controller redirects to the previous state (storing and using a state name) after successful login. When authenticating through a provider, the first call to provider stores the previous URL (not state, URL) in the session. Then, when provider actually calls the authentication callback, session redirect_to path is used for redirecting user.
- Loading branch information
Showing
5 changed files
with
65 additions
and
32 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
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
26 changes: 7 additions & 19 deletions
26
modules/users/client/views/authentication/authentication.client.view.html
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,24 +1,12 @@ | ||
<section class="row"> | ||
<section class="row" data-ng-controller="AuthenticationController"> | ||
<h3 class="col-md-12 text-center">Sign in using your social accounts</h3> | ||
<div class="col-md-12 text-center"> | ||
<a href="/api/auth/facebook" target="_self" class="undecorated-link"> | ||
<img src="/modules/users/img/buttons/facebook.png"> | ||
</a> | ||
<a href="/api/auth/twitter" target="_self" class="undecorated-link"> | ||
<img src="/modules/users/img/buttons/twitter.png"> | ||
</a> | ||
<a href="/api/auth/google" target="_self" class="undecorated-link"> | ||
<img src="/modules/users/img/buttons/google.png"> | ||
</a> | ||
<a href="/api/auth/linkedin" target="_self" class="undecorated-link"> | ||
<img src="/modules/users/img/buttons/linkedin.png"> | ||
</a> | ||
<a href="/api/auth/github" target="_self" class="undecorated-link"> | ||
<img src="/modules/users/img/buttons/github.png"> | ||
</a> | ||
<a href="/api/auth/paypal" target="_self" class="undecorated-link"> | ||
<img src="/modules/users/img/buttons/paypal.png"> | ||
</a> | ||
<img ng-click="callOauthProvider('/api/auth/facebook')" ng-src="/modules/users/img/buttons/facebook.png"> | ||
<img ng-click="callOauthProvider('/api/auth/twitter')" ng-src="/modules/users/img/buttons/twitter.png"> | ||
<img ng-click="callOauthProvider('/api/auth/google')" ng-src="/modules/users/img/buttons/google.png"> | ||
<img ng-click="callOauthProvider('/api/auth/linkedin')" ng-src="/modules/users/img/buttons/linkedin.png"> | ||
<img ng-click="callOauthProvider('/api/auth/github')" ng-src="/modules/users/img/buttons/github.png"> | ||
<img ng-click="callOauthProvider('/api/auth/paypal')" ng-src="/modules/users/img/buttons/paypal.png"> | ||
</div> | ||
<div ui-view></div> | ||
</section> |
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