@glissandoo/lib 1.0.13 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/helpers/auth.d.ts +16 -0
- package/helpers/auth.js +21 -0
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GroupPlayerRole } from '../models/Group/Player/types';
|
|
2
|
+
export interface AuthUserClaims {
|
|
3
|
+
groups?: Record<string, GroupPlayerRole>;
|
|
4
|
+
federation?: string;
|
|
5
|
+
partnership?: string;
|
|
6
|
+
superAdmin?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare enum AuthErrors {
|
|
9
|
+
NoSuperAdmin = "user/no-superadmin",
|
|
10
|
+
NoGroupAdmin = "user/no-group-admin",
|
|
11
|
+
NoGroups = "user/no-groups",
|
|
12
|
+
NoFederationAdmin = "user/no-federation-admin",
|
|
13
|
+
NoPartnerhispAdmin = "user/no-partnership-admin",
|
|
14
|
+
Unautenticated = "Unautenticated"
|
|
15
|
+
}
|
|
16
|
+
export declare const getRedirectSignIn: (return_host?: string | undefined) => string;
|
package/helpers/auth.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRedirectSignIn = exports.AuthErrors = void 0;
|
|
4
|
+
const SIGNIN_PAGE = 'https://auth.glissandoo.com/signin';
|
|
5
|
+
var AuthErrors;
|
|
6
|
+
(function (AuthErrors) {
|
|
7
|
+
AuthErrors["NoSuperAdmin"] = "user/no-superadmin";
|
|
8
|
+
AuthErrors["NoGroupAdmin"] = "user/no-group-admin";
|
|
9
|
+
AuthErrors["NoGroups"] = "user/no-groups";
|
|
10
|
+
AuthErrors["NoFederationAdmin"] = "user/no-federation-admin";
|
|
11
|
+
AuthErrors["NoPartnerhispAdmin"] = "user/no-partnership-admin";
|
|
12
|
+
AuthErrors["Unautenticated"] = "Unautenticated";
|
|
13
|
+
})(AuthErrors = exports.AuthErrors || (exports.AuthErrors = {}));
|
|
14
|
+
const getRedirectSignIn = (return_host) => {
|
|
15
|
+
const url = SIGNIN_PAGE;
|
|
16
|
+
if (return_host) {
|
|
17
|
+
url.concat(`?return_host=${return_host}`);
|
|
18
|
+
}
|
|
19
|
+
return url;
|
|
20
|
+
};
|
|
21
|
+
exports.getRedirectSignIn = getRedirectSignIn;
|