Compare commits

...

6 Commits

Author SHA1 Message Date
Adolfo R. Brandes
967c52bde9 1.0.0-alpha.3 2025-06-29 13:20:08 +02:00
Adolfo R. Brandes
3252b593fd fix: bump frontend-base
Bump frontend-base to alpha.4 to fix a bug with the route role
redirection mechanism.
2025-06-29 13:19:33 +02:00
Adolfo R. Brandes
c98b9a1408 1.0.0-alpha.2 2025-06-29 13:11:02 +02:00
Adolfo R. Brandes
b6c659ccb8 feat: redirect to route role on successful login
Now we have a way to discover app URLs dynamically; do so for the
(default) redirect on login.
2025-06-29 13:09:17 +02:00
Adolfo R. Brandes
7efa279a29 1.0.0-alpha.1 2025-06-28 22:16:19 +02:00
Adolfo R. Brandes
f83f24af89 chore: bump frontend-base 2025-06-28 22:16:07 +02:00
3 changed files with 14 additions and 11 deletions

12
package-lock.json generated
View File

@@ -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": {

View File

@@ -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",

View File

@@ -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,
};
}