-
-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e38eda3
commit 8db991d
Showing
23 changed files
with
389 additions
and
268 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
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
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,34 @@ | ||
/** | ||
* Page-specific Javascript file. Should generally be included as a separate asset bundle in your page template. | ||
* example: {{ assets.js('js/pages/sign-in-or-register') | raw }} | ||
* | ||
* This script depends on validation rules specified in components/page.js.twig. | ||
* | ||
* Target page: account/sign-in | ||
*/ | ||
$(document).ready(function() { | ||
/** | ||
* If there is a redirect parameter in the query string, redirect to that page. | ||
* Otherwise, if there is a UF-Redirect header, redirect to that page. | ||
* Otherwise, redirect to the home page. | ||
*/ | ||
function redirectOnLogin(jqXHR) { | ||
var components = URI.parse(window.location.href); | ||
var query = URI.parseQuery(components['query']); | ||
|
||
if (query && query['redirect']) { | ||
window.location.replace(site.uri.public + '/' + query['redirect']); | ||
} else if (jqXHR.getResponseHeader('UF-Redirect')) { | ||
window.location.replace(jqXHR.getResponseHeader('UF-Redirect')); | ||
} else { | ||
window.location.replace(site.uri.public); | ||
} | ||
} | ||
|
||
$("#sign-in").ufForm({ | ||
validators: page.validators.login, | ||
msgTarget: $("#alerts-page") | ||
}).on("submitSuccess.ufForm", function(event, data, textStatus, jqXHR) { | ||
redirectOnLogin(jqXHR); | ||
}); | ||
}); |
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
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
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
Oops, something went wrong.