Compare commits
6 Commits
v1.0.0-alp
...
v1.0.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
967c52bde9 | ||
|
|
3252b593fd | ||
|
|
c98b9a1408 | ||
|
|
b6c659ccb8 | ||
|
|
7efa279a29 | ||
|
|
f83f24af89 |
12
package-lock.json
generated
12
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@openedx/frontend-app-authn",
|
||||
"version": "1.0.0-alpha.0",
|
||||
"version": "1.0.0-alpha.3",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@openedx/frontend-app-authn",
|
||||
"version": "1.0.0-alpha.0",
|
||||
"version": "1.0.0-alpha.3",
|
||||
"license": "AGPL-3.0",
|
||||
"dependencies": {
|
||||
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.3",
|
||||
@@ -41,7 +41,7 @@
|
||||
"react-test-renderer": "^18.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@openedx/frontend-base": "^1.0.0-alpha.1",
|
||||
"@openedx/frontend-base": "^1.0.0-alpha.4",
|
||||
"@openedx/paragon": "^22",
|
||||
"react": "^18",
|
||||
"react-dom": "^18",
|
||||
@@ -3666,9 +3666,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@openedx/frontend-base": {
|
||||
"version": "1.0.0-alpha.1",
|
||||
"resolved": "https://registry.npmjs.org/@openedx/frontend-base/-/frontend-base-1.0.0-alpha.1.tgz",
|
||||
"integrity": "sha512-8NSHhC32FMlvFhXBggCyNE1uZ0bghtq3a0iY8W0/7S+9XZUUOQrvb0w+YUIkpf0CrzxS8jV0eRh4W5EF4IBVyQ==",
|
||||
"version": "1.0.0-alpha.4",
|
||||
"resolved": "https://registry.npmjs.org/@openedx/frontend-base/-/frontend-base-1.0.0-alpha.4.tgz",
|
||||
"integrity": "sha512-dCaLztXakHThHymafTZrnwqgHik2RidJcQ5kz7hsmkNUs2FPTlwqdX2kO0oR0OjEp+k+gbeMHHS7/ZoWM4DU3Q==",
|
||||
"license": "AGPL-3.0",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openedx/frontend-app-authn",
|
||||
"version": "1.0.0-alpha.0",
|
||||
"version": "1.0.0-alpha.3",
|
||||
"description": "Frontend authentication",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -67,7 +67,7 @@
|
||||
"react-test-renderer": "^18.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@openedx/frontend-base": "^1.0.0-alpha.1",
|
||||
"@openedx/frontend-base": "^1.0.0-alpha.4",
|
||||
"@openedx/paragon": "^22",
|
||||
"react": "^18",
|
||||
"react-dom": "^18",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getAuthenticatedHttpClient, getSiteConfig } from '@openedx/frontend-base';
|
||||
import { getAuthenticatedHttpClient, getSiteConfig, getUrlByRouteRole } from '@openedx/frontend-base';
|
||||
import * as QueryString from 'query-string';
|
||||
|
||||
export async function loginRequest(creds) {
|
||||
@@ -17,8 +17,11 @@ export async function loginRequest(creds) {
|
||||
throw (e);
|
||||
});
|
||||
|
||||
const defaultRedirectUrl = getUrlByRouteRole('org.openedx.frontend.role.dashboard');
|
||||
const redirectUrl = data.redirect_url ?? defaultRedirectUrl;
|
||||
|
||||
return {
|
||||
redirectUrl: data.redirect_url || `${getSiteConfig().lmsBaseUrl}/dashboard`,
|
||||
success: data.success || false,
|
||||
redirectUrl,
|
||||
success: data.success ?? false,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user