Compare commits
2 Commits
v1.0.0-alp
...
v1.0.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c98b9a1408 | ||
|
|
b6c659ccb8 |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@openedx/frontend-app-authn",
|
||||
"version": "1.0.0-alpha.1",
|
||||
"version": "1.0.0-alpha.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@openedx/frontend-app-authn",
|
||||
"version": "1.0.0-alpha.1",
|
||||
"version": "1.0.0-alpha.2",
|
||||
"license": "AGPL-3.0",
|
||||
"dependencies": {
|
||||
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.3",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openedx/frontend-app-authn",
|
||||
"version": "1.0.0-alpha.1",
|
||||
"version": "1.0.0-alpha.2",
|
||||
"description": "Frontend authentication",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -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