Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c8b8013200 | |||
| 0b8639b033 | |||
| 08828d6771 | |||
| aa5cc9ff81 | |||
| 944f689165 | |||
| 0d613fd634 | |||
| a94d1875bd | |||
| 46844fed58 | |||
| 03a8536297 | |||
| 1bfdc67a0e | |||
| 3cb79c8dbe | |||
| c547105ab6 | |||
| f7600ca83f | |||
| 2c0e771da2 | |||
| 4deaafc3a2 |
@@ -1,5 +1,62 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2025-04-03 - 1.4.3 - fix(website)
|
||||||
|
Update packageManager configuration in package.json and refine view container background styling
|
||||||
|
|
||||||
|
- Add 'packageManager' field in package.json to pin pnpm version
|
||||||
|
- Adjust background style in ts_web/views/viewcontainer.ts for improved UI consistency
|
||||||
|
|
||||||
|
## 2024-12-11 - 1.5.0 - feat(UI)
|
||||||
|
Added 'Learn more about idp.global' button
|
||||||
|
|
||||||
|
- Added a new button for learning more about idp.global in the welcome component
|
||||||
|
|
||||||
|
## 2024-12-11 - 1.5.0 - feat(UI)
|
||||||
|
Added 'Learn more about idp.global' button
|
||||||
|
|
||||||
|
- Added a new button for learning more about idp.global in the welcome component
|
||||||
|
|
||||||
|
## 2024-10-12 - 1.4.2 - fix(UI)
|
||||||
|
Improve text rendering in account navigation.
|
||||||
|
|
||||||
|
- Fix for text alignment in the commit info section of the account navigation.
|
||||||
|
- Adjusted font settings for better readability.
|
||||||
|
|
||||||
|
## 2024-10-07 - 1.4.1 - fix(core)
|
||||||
|
Bug fixes and UI enhancements
|
||||||
|
|
||||||
|
- Updated packages to resolve compatibility issues.
|
||||||
|
- Optimized the transition animations for the center container.
|
||||||
|
- Improved the initialization logic for navigating between views.
|
||||||
|
- Enhanced UI with better organization selection handling.
|
||||||
|
|
||||||
|
## 2024-10-07 - 1.4.0 - feat(core)
|
||||||
|
Refactored plugin and request handling to use 'idpInterfaces'
|
||||||
|
|
||||||
|
- Switched from using 'lointReception' to 'idpInterfaces' in various TypeScript sources.
|
||||||
|
- Updated references to request and data interfaces across multiple modules.
|
||||||
|
- Improved account handling with new navigation options.
|
||||||
|
|
||||||
|
## 2024-10-07 - 1.3.1 - fix(account)
|
||||||
|
Fix: updated cleanupViews method to correctly iterate over children.
|
||||||
|
|
||||||
|
- Fixed the iteration over view container children by converting it to an array before removing children. This resolves potential errors due to incorrect for-loop execution on HTMLCollection.
|
||||||
|
|
||||||
|
## 2024-10-06 - 1.3.0 - feat(account)
|
||||||
|
Implement account and organization management features
|
||||||
|
|
||||||
|
- Added account management UI with organization selection
|
||||||
|
- Introduced organization creation and selection functionalities
|
||||||
|
- Implemented subscription view with Paddle setup integration
|
||||||
|
|
||||||
|
## 2024-10-04 - 1.2.2 - fix(core)
|
||||||
|
Update dependencies and refactor registration process
|
||||||
|
|
||||||
|
- Updated @design.estate/dees-catalog, @design.estate/dees-domtools, and @design.estate/dees-element dependencies to their latest versions.
|
||||||
|
- Refactored registration process to improve validation flow.
|
||||||
|
- Improved user interface for login and registration prompts.
|
||||||
|
- Fixed issues with email and token validation during registration.
|
||||||
|
|
||||||
## 2024-10-04 - 1.2.1 - fix(core)
|
## 2024-10-04 - 1.2.1 - fix(core)
|
||||||
Added logging for user email login process and fixed client URL parsing
|
Added logging for user email login process and fixed client URL parsing
|
||||||
|
|
||||||
|
|||||||
+7
-6
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@idp.global/idp.global",
|
"name": "@idp.global/idp.global",
|
||||||
"version": "1.2.1",
|
"version": "1.4.3",
|
||||||
"description": "An identity provider software managing user authentications, registrations, and sessions.",
|
"description": "An identity provider software managing user authentications, registrations, and sessions.",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist_ts/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
@@ -21,9 +21,9 @@
|
|||||||
"@api.global/typedserver": "^3.0.51",
|
"@api.global/typedserver": "^3.0.51",
|
||||||
"@api.global/typedsocket": "^3.0.1",
|
"@api.global/typedsocket": "^3.0.1",
|
||||||
"@consentsoftware_private/catalog": "^1.0.73",
|
"@consentsoftware_private/catalog": "^1.0.73",
|
||||||
"@design.estate/dees-catalog": "^1.1.8",
|
"@design.estate/dees-catalog": "^1.2.0",
|
||||||
"@design.estate/dees-domtools": "^2.0.60",
|
"@design.estate/dees-domtools": "^2.0.64",
|
||||||
"@design.estate/dees-element": "^2.0.38",
|
"@design.estate/dees-element": "^2.0.39",
|
||||||
"@push.rocks/lik": "^6.0.15",
|
"@push.rocks/lik": "^6.0.15",
|
||||||
"@push.rocks/qenv": "^6.0.5",
|
"@push.rocks/qenv": "^6.0.5",
|
||||||
"@push.rocks/smartdata": "^5.2.10",
|
"@push.rocks/smartdata": "^5.2.10",
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
"@push.rocks/webjwt": "^1.0.9",
|
"@push.rocks/webjwt": "^1.0.9",
|
||||||
"@push.rocks/websetup": "^3.0.15",
|
"@push.rocks/websetup": "^3.0.15",
|
||||||
"@push.rocks/webstore": "^2.0.20",
|
"@push.rocks/webstore": "^2.0.20",
|
||||||
"@serve.zone/platformclient": "^1.0.11",
|
"@serve.zone/platformclient": "^1.1.2",
|
||||||
"@tsclass/tsclass": "^4.1.2",
|
"@tsclass/tsclass": "^4.1.2",
|
||||||
"@uptime.link/webwidget": "^1.1.2"
|
"@uptime.link/webwidget": "^1.1.2"
|
||||||
},
|
},
|
||||||
@@ -101,5 +101,6 @@
|
|||||||
"API",
|
"API",
|
||||||
"user data",
|
"user data",
|
||||||
"user sessions"
|
"user sessions"
|
||||||
]
|
],
|
||||||
|
"packageManager": "pnpm@10.7.0+sha512.6b865ad4b62a1d9842b61d674a393903b871d9244954f652b8842c2b553c72176b278f64c463e52d40fff8aba385c235c8c9ecf5cc7de4fd78b8bb6d49633ab6"
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+366
-355
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@idp.global/idp.global',
|
name: '@idp.global/idp.global',
|
||||||
version: '1.2.1',
|
version: '1.4.3',
|
||||||
description: 'An identity provider software managing user authentications, registrations, and sessions.'
|
description: 'An identity provider software managing user authentications, registrations, and sessions.'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export const runCli = async () => {
|
|||||||
mongoDbUrl: await serviceQenv.getEnvVarOnDemand('MONGO_DB_URL'),
|
mongoDbUrl: await serviceQenv.getEnvVarOnDemand('MONGO_DB_URL'),
|
||||||
},
|
},
|
||||||
websiteServer: websiteServer,
|
websiteServer: websiteServer,
|
||||||
|
baseUrl: await serviceQenv.getEnvVarOnDemand('IDP_BASEURL'),
|
||||||
});
|
});
|
||||||
await reception.start();
|
await reception.start();
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -3,8 +3,8 @@ import * as path from 'path';
|
|||||||
export { path };
|
export { path };
|
||||||
|
|
||||||
// Project scope
|
// Project scope
|
||||||
import * as lointReception from '../dist_ts_interfaces/index.js';
|
import * as idpInterfaces from '../dist_ts_interfaces/index.js';
|
||||||
export { lointReception };
|
export { idpInterfaces };
|
||||||
|
|
||||||
// @api.global scope
|
// @api.global scope
|
||||||
import * as typedserver from '@api.global/typedserver';
|
import * as typedserver from '@api.global/typedserver';
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { User } from './classes.user.js';
|
|||||||
@plugins.smartdata.Manager()
|
@plugins.smartdata.Manager()
|
||||||
export class BillingPlan extends plugins.smartdata.SmartDataDbDoc<
|
export class BillingPlan extends plugins.smartdata.SmartDataDbDoc<
|
||||||
BillingPlan,
|
BillingPlan,
|
||||||
plugins.lointReception.data.IBillingPlan,
|
plugins.idpInterfaces.data.IBillingPlan,
|
||||||
BillingPlanManager
|
BillingPlanManager
|
||||||
> {
|
> {
|
||||||
// STATIC
|
// STATIC
|
||||||
@@ -20,7 +20,7 @@ export class BillingPlan extends plugins.smartdata.SmartDataDbDoc<
|
|||||||
public id: string;
|
public id: string;
|
||||||
|
|
||||||
@plugins.smartdata.svDb()
|
@plugins.smartdata.svDb()
|
||||||
public data: plugins.lointReception.data.IBillingPlan['data'] = {
|
public data: plugins.idpInterfaces.data.IBillingPlan['data'] = {
|
||||||
type: null,
|
type: null,
|
||||||
organizationId: null,
|
organizationId: null,
|
||||||
lastProcessed: null,
|
lastProcessed: null,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export class BillingPlanManager {
|
|||||||
constructor(receptionRefArg: Reception) {
|
constructor(receptionRefArg: Reception) {
|
||||||
this.receptionRef = receptionRefArg;
|
this.receptionRef = receptionRefArg;
|
||||||
this.receptionRef.typedrouter.addTypedRouter(this.typedrouter);
|
this.receptionRef.typedrouter.addTypedRouter(this.typedrouter);
|
||||||
this.typedrouter.addTypedHandler(new plugins.typedrequest.TypedHandler<plugins.lointReception.request.IReq_UpdatePaymentMethod>('updatePaymentMethod', async reqDataArg => {
|
this.typedrouter.addTypedHandler(new plugins.typedrequest.TypedHandler<plugins.idpInterfaces.request.IReq_UpdatePaymentMethod>('updatePaymentMethod', async reqDataArg => {
|
||||||
const user = await this.receptionRef.userManager.getUserByJwt(reqDataArg.jwtString);
|
const user = await this.receptionRef.userManager.getUserByJwt(reqDataArg.jwtString);
|
||||||
const organization = await this.receptionRef.organizationmanager.COrganization.getInstance({
|
const organization = await this.receptionRef.organizationmanager.COrganization.getInstance({
|
||||||
id: reqDataArg.orgId,
|
id: reqDataArg.orgId,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { JwtManager } from './classes.jwtmanager.js';
|
|||||||
* Both need to be unique and both can be changed.
|
* Both need to be unique and both can be changed.
|
||||||
*/
|
*/
|
||||||
@plugins.smartdata.Manager()
|
@plugins.smartdata.Manager()
|
||||||
export class Jwt extends plugins.smartdata.SmartDataDbDoc<Jwt, plugins.lointReception.data.IJwt, JwtManager> {
|
export class Jwt extends plugins.smartdata.SmartDataDbDoc<Jwt, plugins.idpInterfaces.data.IJwt, JwtManager> {
|
||||||
// STATIC
|
// STATIC
|
||||||
public static async createJwtForRefreshToken(
|
public static async createJwtForRefreshToken(
|
||||||
jwtManagerInstance: JwtManager,
|
jwtManagerInstance: JwtManager,
|
||||||
@@ -48,7 +48,7 @@ export class Jwt extends plugins.smartdata.SmartDataDbDoc<Jwt, plugins.lointRece
|
|||||||
id: jwt.id,
|
id: jwt.id,
|
||||||
blocked: null,
|
blocked: null,
|
||||||
data: jwt.data,
|
data: jwt.data,
|
||||||
} as plugins.lointReception.data.IJwt);
|
} as plugins.idpInterfaces.data.IJwt);
|
||||||
return jwtString;
|
return jwtString;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ export class Jwt extends plugins.smartdata.SmartDataDbDoc<Jwt, plugins.lointRece
|
|||||||
public blocked: boolean = false;
|
public blocked: boolean = false;
|
||||||
|
|
||||||
@plugins.smartdata.svDb()
|
@plugins.smartdata.svDb()
|
||||||
public data: plugins.lointReception.data.IJwt['data'];
|
public data: plugins.idpInterfaces.data.IJwt['data'];
|
||||||
|
|
||||||
public async block() {
|
public async block() {
|
||||||
this.blocked = true;
|
this.blocked = true;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export class JwtManager {
|
|||||||
constructor(receptionRefArg: Reception) {
|
constructor(receptionRefArg: Reception) {
|
||||||
this.receptionRef = receptionRefArg;
|
this.receptionRef = receptionRefArg;
|
||||||
this.receptionRef.typedrouter.addTypedRouter(this.typedrouter);
|
this.receptionRef.typedrouter.addTypedRouter(this.typedrouter);
|
||||||
this.typedrouter.addTypedHandler<plugins.lointReception.request.IReq_RefreshJwt>(
|
this.typedrouter.addTypedHandler<plugins.idpInterfaces.request.IReq_RefreshJwt>(
|
||||||
new plugins.typedrequest.TypedHandler(
|
new plugins.typedrequest.TypedHandler(
|
||||||
'refreshJwt',
|
'refreshJwt',
|
||||||
async (requestArg) => {
|
async (requestArg) => {
|
||||||
@@ -34,7 +34,7 @@ export class JwtManager {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
this.typedrouter.addTypedHandler(
|
this.typedrouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<plugins.lointReception.request.IReq_GetPublicKeyForValidation>(
|
new plugins.typedrequest.TypedHandler<plugins.idpInterfaces.request.IReq_GetPublicKeyForValidation>(
|
||||||
'getPublicKeyForValidation',
|
'getPublicKeyForValidation',
|
||||||
async (requestArg) => {
|
async (requestArg) => {
|
||||||
// TODO control backend token
|
// TODO control backend token
|
||||||
@@ -46,7 +46,7 @@ export class JwtManager {
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.typedrouter.addTypedHandler(
|
this.typedrouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<plugins.lointReception.request.IReq_PushOrGetJwtIdBlocklist>(
|
new plugins.typedrequest.TypedHandler<plugins.idpInterfaces.request.IReq_PushOrGetJwtIdBlocklist>(
|
||||||
'pushOrGetJwtIdBlocklist',
|
'pushOrGetJwtIdBlocklist',
|
||||||
async (requestArg) => {
|
async (requestArg) => {
|
||||||
// TODO control backend token
|
// TODO control backend token
|
||||||
@@ -60,7 +60,7 @@ export class JwtManager {
|
|||||||
|
|
||||||
public async pushPublicKeyToClients() {
|
public async pushPublicKeyToClients() {
|
||||||
const targetConnections =
|
const targetConnections =
|
||||||
await this.receptionRef.options.websiteServer.typedserver.typedsocket.findAllTargetConnectionsByTag<plugins.lointReception.tags.ITag_LolePubapi>(
|
await this.receptionRef.options.websiteServer.typedserver.typedsocket.findAllTargetConnectionsByTag<plugins.idpInterfaces.tags.ITag_LolePubapi>(
|
||||||
'lole-reception',
|
'lole-reception',
|
||||||
{
|
{
|
||||||
backendToken: '',
|
backendToken: '',
|
||||||
@@ -68,7 +68,7 @@ export class JwtManager {
|
|||||||
);
|
);
|
||||||
for (const targetConnection of targetConnections) {
|
for (const targetConnection of targetConnections) {
|
||||||
const pushPublicKeyTr =
|
const pushPublicKeyTr =
|
||||||
this.receptionRef.options.websiteServer.typedserver.typedsocket.createTypedRequest<plugins.lointReception.request.IReq_PushPublicKeyForValidation>(
|
this.receptionRef.options.websiteServer.typedserver.typedsocket.createTypedRequest<plugins.idpInterfaces.request.IReq_PushPublicKeyForValidation>(
|
||||||
'pushPublicKeyForValidation',
|
'pushPublicKeyForValidation',
|
||||||
targetConnection
|
targetConnection
|
||||||
);
|
);
|
||||||
@@ -80,7 +80,7 @@ export class JwtManager {
|
|||||||
|
|
||||||
public async pushBlockedJwtIdListToClients() {
|
public async pushBlockedJwtIdListToClients() {
|
||||||
const targetConnections =
|
const targetConnections =
|
||||||
await this.receptionRef.options.websiteServer.typedserver.typedsocket.findAllTargetConnectionsByTag<plugins.lointReception.tags.ITag_LolePubapi>(
|
await this.receptionRef.options.websiteServer.typedserver.typedsocket.findAllTargetConnectionsByTag<plugins.idpInterfaces.tags.ITag_LolePubapi>(
|
||||||
'lole-reception',
|
'lole-reception',
|
||||||
{
|
{
|
||||||
backendToken: '',
|
backendToken: '',
|
||||||
@@ -88,7 +88,7 @@ export class JwtManager {
|
|||||||
);
|
);
|
||||||
for (const targetConnection of targetConnections) {
|
for (const targetConnection of targetConnections) {
|
||||||
const pushPublicKeyTr =
|
const pushPublicKeyTr =
|
||||||
this.receptionRef.options.websiteServer.typedserver.typedsocket.createTypedRequest<plugins.lointReception.request.IReq_PushOrGetJwtIdBlocklist>(
|
this.receptionRef.options.websiteServer.typedserver.typedsocket.createTypedRequest<plugins.idpInterfaces.request.IReq_PushOrGetJwtIdBlocklist>(
|
||||||
'pushOrGetJwtIdBlocklist',
|
'pushOrGetJwtIdBlocklist',
|
||||||
targetConnection
|
targetConnection
|
||||||
);
|
);
|
||||||
@@ -121,7 +121,7 @@ export class JwtManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async verifyJWTAndGetData(jwtArg: string): Promise<Jwt> {
|
public async verifyJWTAndGetData(jwtArg: string): Promise<Jwt> {
|
||||||
const jwtData: plugins.lointReception.data.IJwt = await this.smartjwtInstance.verifyJWTAndGetData(jwtArg);
|
const jwtData: plugins.idpInterfaces.data.IJwt = await this.smartjwtInstance.verifyJWTAndGetData(jwtArg);
|
||||||
const jwt = await Jwt.getInstance({
|
const jwt = await Jwt.getInstance({
|
||||||
id: jwtData.id,
|
id: jwtData.id,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { User } from './classes.user.js';
|
|||||||
@plugins.smartdata.Manager()
|
@plugins.smartdata.Manager()
|
||||||
export class LoginSession extends plugins.smartdata.SmartDataDbDoc<
|
export class LoginSession extends plugins.smartdata.SmartDataDbDoc<
|
||||||
LoginSession,
|
LoginSession,
|
||||||
plugins.lointReception.data.ILoginSession,
|
plugins.idpInterfaces.data.ILoginSession,
|
||||||
LoginSessionManager
|
LoginSessionManager
|
||||||
> {
|
> {
|
||||||
// ======
|
// ======
|
||||||
@@ -55,7 +55,7 @@ export class LoginSession extends plugins.smartdata.SmartDataDbDoc<
|
|||||||
public id: string;
|
public id: string;
|
||||||
|
|
||||||
@plugins.smartdata.svDb()
|
@plugins.smartdata.svDb()
|
||||||
public data: plugins.lointReception.data.ILoginSession['data'] = {
|
public data: plugins.idpInterfaces.data.ILoginSession['data'] = {
|
||||||
userId: null,
|
userId: null,
|
||||||
validUntil: Date.now() + plugins.smarttime.getMilliSecondsFromUnits({ weeks: 1 }),
|
validUntil: Date.now() + plugins.smarttime.getMilliSecondsFromUnits({ weeks: 1 }),
|
||||||
invalidated: false,
|
invalidated: false,
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export class LoginSessionManager {
|
|||||||
this.receptionRef = receptionRefArg;
|
this.receptionRef = receptionRefArg;
|
||||||
this.receptionRef.typedrouter.addTypedRouter(this.typedRouter);
|
this.receptionRef.typedrouter.addTypedRouter(this.typedRouter);
|
||||||
this.typedRouter.addTypedHandler(
|
this.typedRouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<plugins.lointReception.request.IReq_LoginWithEmailOrUsernameAndPassword>(
|
new plugins.typedrequest.TypedHandler<plugins.idpInterfaces.request.IReq_LoginWithEmailOrUsernameAndPassword>(
|
||||||
'loginWithEmailOrUsernameAndPassword',
|
'loginWithEmailOrUsernameAndPassword',
|
||||||
async (requestData) => {
|
async (requestData) => {
|
||||||
let user = await this.receptionRef.userManager.CUser.getInstance({
|
let user = await this.receptionRef.userManager.CUser.getInstance({
|
||||||
@@ -79,7 +79,7 @@ export class LoginSessionManager {
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.typedRouter.addTypedHandler(
|
this.typedRouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<plugins.lointReception.request.IReq_LoginWithEmail>(
|
new plugins.typedrequest.TypedHandler<plugins.idpInterfaces.request.IReq_LoginWithEmail>(
|
||||||
'loginWithEmail',
|
'loginWithEmail',
|
||||||
async (requestDataArg) => {
|
async (requestDataArg) => {
|
||||||
logger.log('info', `loginWithEmail requested for: ${requestDataArg.email}`);
|
logger.log('info', `loginWithEmail requested for: ${requestDataArg.email}`);
|
||||||
@@ -121,7 +121,7 @@ export class LoginSessionManager {
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.typedRouter.addTypedHandler(
|
this.typedRouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<plugins.lointReception.request.IReq_LoginWithEmailAfterEmailTokenAquired>(
|
new plugins.typedrequest.TypedHandler<plugins.idpInterfaces.request.IReq_LoginWithEmailAfterEmailTokenAquired>(
|
||||||
'loginWithEmailAfterEmailTokenAquired',
|
'loginWithEmailAfterEmailTokenAquired',
|
||||||
async (requestArg) => {
|
async (requestArg) => {
|
||||||
const tokenObject = this.emailTokenMap.findSync((itemArg) => {
|
const tokenObject = this.emailTokenMap.findSync((itemArg) => {
|
||||||
@@ -145,7 +145,7 @@ export class LoginSessionManager {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
this.typedRouter.addTypedHandler<plugins.lointReception.request.ILogoutRequest>(
|
this.typedRouter.addTypedHandler<plugins.idpInterfaces.request.ILogoutRequest>(
|
||||||
new plugins.typedrequest.TypedHandler('logout', async (requestDataArg) => {
|
new plugins.typedrequest.TypedHandler('logout', async (requestDataArg) => {
|
||||||
const loginSession = await this.CLoginSession.getLoginSessionByRefreshToken(requestDataArg.refreshToken);
|
const loginSession = await this.CLoginSession.getLoginSessionByRefreshToken(requestDataArg.refreshToken);
|
||||||
await loginSession.invalidate();
|
await loginSession.invalidate();
|
||||||
@@ -153,7 +153,7 @@ export class LoginSessionManager {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
this.typedRouter.addTypedHandler<plugins.lointReception.request.IReq_ExchangeRefreshTokenAndTransferToken>(
|
this.typedRouter.addTypedHandler<plugins.idpInterfaces.request.IReq_ExchangeRefreshTokenAndTransferToken>(
|
||||||
new plugins.typedrequest.TypedHandler(
|
new plugins.typedrequest.TypedHandler(
|
||||||
'exchangeRefreshTokenAndTransferToken',
|
'exchangeRefreshTokenAndTransferToken',
|
||||||
async (requestDataArg) => {
|
async (requestDataArg) => {
|
||||||
@@ -189,7 +189,7 @@ export class LoginSessionManager {
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.typedRouter.addTypedHandler(
|
this.typedRouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<plugins.lointReception.request.IReq_ResetPassword>(
|
new plugins.typedrequest.TypedHandler<plugins.idpInterfaces.request.IReq_ResetPassword>(
|
||||||
'resetPassword',
|
'resetPassword',
|
||||||
async (requestDataArg) => {
|
async (requestDataArg) => {
|
||||||
const emailOfPasswordToReset = requestDataArg.email;
|
const emailOfPasswordToReset = requestDataArg.email;
|
||||||
@@ -227,7 +227,7 @@ export class LoginSessionManager {
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.typedRouter.addTypedHandler(
|
this.typedRouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<plugins.lointReception.request.IReq_SetNewPassword>(
|
new plugins.typedrequest.TypedHandler<plugins.idpInterfaces.request.IReq_SetNewPassword>(
|
||||||
'setNewPassword',
|
'setNewPassword',
|
||||||
async (requestData) => {
|
async (requestData) => {
|
||||||
return {
|
return {
|
||||||
@@ -241,7 +241,7 @@ export class LoginSessionManager {
|
|||||||
* returns a device id by simply returning a uuid4
|
* returns a device id by simply returning a uuid4
|
||||||
*/
|
*/
|
||||||
this.typedRouter.addTypedHandler(
|
this.typedRouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<plugins.lointReception.request.IReq_ObtainDeviceId>('obtainDeviceId', async (reqData) => {
|
new plugins.typedrequest.TypedHandler<plugins.idpInterfaces.request.IReq_ObtainDeviceId>('obtainDeviceId', async (reqData) => {
|
||||||
reqData;
|
reqData;
|
||||||
return {
|
return {
|
||||||
deviceId: {
|
deviceId: {
|
||||||
@@ -252,7 +252,7 @@ export class LoginSessionManager {
|
|||||||
)
|
)
|
||||||
|
|
||||||
this.typedRouter.addTypedHandler(
|
this.typedRouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<plugins.lointReception.request.IReq_AttachDeviceId>('attachDeviceId', async (reqData) => {
|
new plugins.typedrequest.TypedHandler<plugins.idpInterfaces.request.IReq_AttachDeviceId>('attachDeviceId', async (reqData) => {
|
||||||
// TODO: Blocked by proper JWT handling
|
// TODO: Blocked by proper JWT handling
|
||||||
reqData.jwt;
|
reqData.jwt;
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { User } from './classes.user.js';
|
|||||||
@plugins.smartdata.Manager()
|
@plugins.smartdata.Manager()
|
||||||
export class Organization extends plugins.smartdata.SmartDataDbDoc<
|
export class Organization extends plugins.smartdata.SmartDataDbDoc<
|
||||||
Organization,
|
Organization,
|
||||||
plugins.lointReception.data.IOrganization,
|
plugins.idpInterfaces.data.IOrganization,
|
||||||
OrganizationManager
|
OrganizationManager
|
||||||
> {
|
> {
|
||||||
public static async createNewOrganizationForUser(
|
public static async createNewOrganizationForUser(
|
||||||
@@ -28,10 +28,10 @@ export class Organization extends plugins.smartdata.SmartDataDbDoc<
|
|||||||
|
|
||||||
// INSTANCE
|
// INSTANCE
|
||||||
@plugins.smartdata.unI()
|
@plugins.smartdata.unI()
|
||||||
id: plugins.lointReception.data.IOrganization['id'];
|
id: plugins.idpInterfaces.data.IOrganization['id'];
|
||||||
|
|
||||||
@plugins.smartdata.svDb()
|
@plugins.smartdata.svDb()
|
||||||
data: plugins.lointReception.data.IOrganization['data'];
|
data: plugins.idpInterfaces.data.IOrganization['data'];
|
||||||
|
|
||||||
public async checkIfUserIsAdmin(userArg: User) {
|
public async checkIfUserIsAdmin(userArg: User) {
|
||||||
const role = await this.manager.receptionRef.roleManager.getRoleForUserAndOrg(userArg, this);
|
const role = await this.manager.receptionRef.roleManager.getRoleForUserAndOrg(userArg, this);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export class OrganizationManager {
|
|||||||
this.receptionRef.typedrouter.addTypedRouter(this.typedrouter);
|
this.receptionRef.typedrouter.addTypedRouter(this.typedrouter);
|
||||||
|
|
||||||
this.typedrouter.addTypedHandler(
|
this.typedrouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<plugins.lointReception.request.IReq_CreateOrganization>(
|
new plugins.typedrequest.TypedHandler<plugins.idpInterfaces.request.IReq_CreateOrganization>(
|
||||||
'createOrganization',
|
'createOrganization',
|
||||||
async (requestArg) => {
|
async (requestArg) => {
|
||||||
const nameIsAvailable = async () => {
|
const nameIsAvailable = async () => {
|
||||||
@@ -64,7 +64,7 @@ export class OrganizationManager {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
this.typedrouter.addTypedHandler(
|
this.typedrouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<plugins.lointReception.request.IReq_GetOrganizationById>(
|
new plugins.typedrequest.TypedHandler<plugins.idpInterfaces.request.IReq_GetOrganizationById>(
|
||||||
'getOrganizationById',
|
'getOrganizationById',
|
||||||
async (requestArg) => {
|
async (requestArg) => {
|
||||||
const verifiedJwt = await this.receptionRef.jwtManager.verifyJWTAndGetData(
|
const verifiedJwt = await this.receptionRef.jwtManager.verifyJWTAndGetData(
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export interface IReceptionOptions {
|
|||||||
name: string;
|
name: string;
|
||||||
mongoDescriptor: plugins.smartdata.IMongoDescriptor;
|
mongoDescriptor: plugins.smartdata.IMongoDescriptor;
|
||||||
websiteServer: plugins.typedserver.utilityservers.UtilityWebsiteServer;
|
websiteServer: plugins.typedserver.utilityservers.UtilityWebsiteServer;
|
||||||
|
baseUrl: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Reception {
|
export class Reception {
|
||||||
@@ -55,6 +56,7 @@ export class Reception {
|
|||||||
* starts the reception instance
|
* starts the reception instance
|
||||||
*/
|
*/
|
||||||
public async start() {
|
public async start() {
|
||||||
|
await this.szPlatformClient.init(await this.serviceQenv.getEnvVarOnDemand('SERVEZONE_PLATFROM_AUTHORIZATION'));
|
||||||
logger.log('info', 'starting reception');
|
logger.log('info', 'starting reception');
|
||||||
logger.log('info', 'adding typedrouter to website server');
|
logger.log('info', 'adding typedrouter to website server');
|
||||||
this.options.websiteServer.typedrouter.addTypedRouter(this.typedrouter);
|
this.options.websiteServer.typedrouter.addTypedRouter(this.typedrouter);
|
||||||
|
|||||||
@@ -152,9 +152,9 @@ export class ReceptionMailer {
|
|||||||
</html>
|
</html>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
public sendRegistrationEmail(signupSessionArg: RegistrationSession, validationTokenArg: string) {
|
public async sendRegistrationEmail(signupSessionArg: RegistrationSession, validationTokenArg: string) {
|
||||||
this.receptionRef.szPlatformClient.emailConnector.sendEmail({
|
this.receptionRef.szPlatformClient.emailConnector.sendEmail({
|
||||||
from: 'workspace.global <noreply@mail.workspace.global>',
|
from: `idp.global@${this.receptionRef.options.baseUrl} <noreply@mail.workspace.global>`,
|
||||||
title: 'Verify your Email Address!',
|
title: 'Verify your Email Address!',
|
||||||
to: signupSessionArg.emailAddress,
|
to: signupSessionArg.emailAddress,
|
||||||
body: this.createBodyString(`
|
body: this.createBodyString(`
|
||||||
@@ -163,7 +163,7 @@ export class ReceptionMailer {
|
|||||||
}">${signupSessionArg.emailAddress}</a></h1>
|
}">${signupSessionArg.emailAddress}</a></h1>
|
||||||
<p>It looks like you requested to register an account with us. We just want to make sure it really was you.</p>
|
<p>It looks like you requested to register an account with us. We just want to make sure it really was you.</p>
|
||||||
<p>In case it was you, <b>please continue with the registration process by clicking the button below</b>. Otherwise, please ignore this email.</p>
|
<p>In case it was you, <b>please continue with the registration process by clicking the button below</b>. Otherwise, please ignore this email.</p>
|
||||||
<a href="https://registration.workspace.global/finishregistration?validationtoken=${encodeURI(
|
<a href="${this.receptionRef.options.baseUrl}/finishregistration?validationtoken=${encodeURI(
|
||||||
validationTokenArg
|
validationTokenArg
|
||||||
)}"><div class="button">
|
)}"><div class="button">
|
||||||
continue with registration
|
continue with registration
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export class RegistrationSession {
|
|||||||
'announced';
|
'announced';
|
||||||
|
|
||||||
public collectedData: {
|
public collectedData: {
|
||||||
userData: plugins.lointReception.data.IUser['data'];
|
userData: plugins.idpInterfaces.data.IUser['data'];
|
||||||
} = {
|
} = {
|
||||||
userData: {
|
userData: {
|
||||||
username: null,
|
username: null,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export class RegistrationSessionManager {
|
|||||||
this.receptionRef.typedrouter.addTypedRouter(this.typedRouter);
|
this.receptionRef.typedrouter.addTypedRouter(this.typedRouter);
|
||||||
|
|
||||||
this.typedRouter.addTypedHandler(
|
this.typedRouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<plugins.lointReception.request.IReq_FirstRegistration>(
|
new plugins.typedrequest.TypedHandler<plugins.idpInterfaces.request.IReq_FirstRegistration>(
|
||||||
'firstRegistrationRequest',
|
'firstRegistrationRequest',
|
||||||
async (requestData) => {
|
async (requestData) => {
|
||||||
// check for exiting User
|
// check for exiting User
|
||||||
@@ -60,9 +60,10 @@ export class RegistrationSessionManager {
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.typedRouter.addTypedHandler(
|
this.typedRouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<plugins.lointReception.request.IReq_AfterRegistrationEmailClicked>(
|
new plugins.typedrequest.TypedHandler<plugins.idpInterfaces.request.IReq_AfterRegistrationEmailClicked>(
|
||||||
'afterRegistrationEmailClicked',
|
'afterRegistrationEmailClicked',
|
||||||
async (requestData) => {
|
async (requestData) => {
|
||||||
|
console.log(requestData);
|
||||||
const signupSession = await this.registrationSessions.find(async (itemArg) =>
|
const signupSession = await this.registrationSessions.find(async (itemArg) =>
|
||||||
itemArg.validateEmailToken(requestData.token)
|
itemArg.validateEmailToken(requestData.token)
|
||||||
);
|
);
|
||||||
@@ -82,7 +83,7 @@ export class RegistrationSessionManager {
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.typedRouter.addTypedHandler(
|
this.typedRouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<plugins.lointReception.request.IReq_SetDataForRegistration>(
|
new plugins.typedrequest.TypedHandler<plugins.idpInterfaces.request.IReq_SetDataForRegistration>(
|
||||||
'setDataForRegistration',
|
'setDataForRegistration',
|
||||||
async (requestData) => {
|
async (requestData) => {
|
||||||
const registrationSession = await this.registrationSessions.find(async (itemArg) =>
|
const registrationSession = await this.registrationSessions.find(async (itemArg) =>
|
||||||
@@ -110,7 +111,7 @@ export class RegistrationSessionManager {
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.typedRouter.addTypedHandler(
|
this.typedRouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<plugins.lointReception.request.IReq_MobileVerificationForRegistration>(
|
new plugins.typedrequest.TypedHandler<plugins.idpInterfaces.request.IReq_MobileVerificationForRegistration>(
|
||||||
'mobileVerificationForRegistration',
|
'mobileVerificationForRegistration',
|
||||||
async (requestData) => {
|
async (requestData) => {
|
||||||
const registrationSession = await this.registrationSessions.find(async (itemArg) =>
|
const registrationSession = await this.registrationSessions.find(async (itemArg) =>
|
||||||
@@ -156,7 +157,7 @@ export class RegistrationSessionManager {
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.typedRouter.addTypedHandler(
|
this.typedRouter.addTypedHandler(
|
||||||
new plugins.typedrequest.TypedHandler<plugins.lointReception.request.IReq_FinishRegistration>(
|
new plugins.typedrequest.TypedHandler<plugins.idpInterfaces.request.IReq_FinishRegistration>(
|
||||||
'finishRegistration',
|
'finishRegistration',
|
||||||
async (requestData) => {
|
async (requestData) => {
|
||||||
const registrationSession = await this.registrationSessions.find(async (itemArg) =>
|
const registrationSession = await this.registrationSessions.find(async (itemArg) =>
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ import * as plugins from '../plugins.js';
|
|||||||
@plugins.smartdata.Manager()
|
@plugins.smartdata.Manager()
|
||||||
export class Role extends plugins.smartdata.SmartDataDbDoc<
|
export class Role extends plugins.smartdata.SmartDataDbDoc<
|
||||||
Role,
|
Role,
|
||||||
plugins.lointReception.data.IRole
|
plugins.idpInterfaces.data.IRole
|
||||||
> {
|
> {
|
||||||
@plugins.smartdata.unI()
|
@plugins.smartdata.unI()
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
@plugins.smartdata.svDb()
|
@plugins.smartdata.svDb()
|
||||||
data: plugins.lointReception.data.IRole['data'];
|
data: plugins.idpInterfaces.data.IRole['data'];
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@ export class RoleManager {
|
|||||||
action: 'create' | 'change' | 'delete';
|
action: 'create' | 'change' | 'delete';
|
||||||
userId: string;
|
userId: string;
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
role: plugins.lointReception.data.IRole['data']['role'];
|
role: plugins.idpInterfaces.data.IRole['data']['role'];
|
||||||
}) {
|
}) {
|
||||||
let returnRole: Role;
|
let returnRole: Role;
|
||||||
switch (optionsArg.action) {
|
switch (optionsArg.action) {
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ import { UserManager } from './classes.usermanager.js';
|
|||||||
@plugins.smartdata.Manager()
|
@plugins.smartdata.Manager()
|
||||||
export class User extends plugins.smartdata.SmartDataDbDoc<
|
export class User extends plugins.smartdata.SmartDataDbDoc<
|
||||||
User,
|
User,
|
||||||
plugins.lointReception.data.IUser
|
plugins.idpInterfaces.data.IUser
|
||||||
> {
|
> {
|
||||||
// STATIC
|
// STATIC
|
||||||
public static async createNewUserForUserData(
|
public static async createNewUserForUserData(
|
||||||
userDataArg: plugins.lointReception.data.IUser['data']
|
userDataArg: plugins.idpInterfaces.data.IUser['data']
|
||||||
): Promise<User> {
|
): Promise<User> {
|
||||||
const newUser = new User();
|
const newUser = new User();
|
||||||
newUser.id = plugins.smartunique.shortId();
|
newUser.id = plugins.smartunique.shortId();
|
||||||
@@ -40,7 +40,7 @@ export class User extends plugins.smartdata.SmartDataDbDoc<
|
|||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
@plugins.smartdata.svDb()
|
@plugins.smartdata.svDb()
|
||||||
public data: plugins.lointReception.data.IUser['data'];
|
public data: plugins.idpInterfaces.data.IUser['data'];
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|||||||
@@ -19,8 +19,9 @@ export class UserManager {
|
|||||||
constructor(receptionRefArg: Reception) {
|
constructor(receptionRefArg: Reception) {
|
||||||
this.receptionRef = receptionRefArg;
|
this.receptionRef = receptionRefArg;
|
||||||
this.receptionRef.typedrouter.addTypedRouter(this.typedrouter);
|
this.receptionRef.typedrouter.addTypedRouter(this.typedrouter);
|
||||||
this.typedrouter.addTypedHandler<plugins.lointReception.request.IReq_GetRolesAndOrganizationsForUserId>(
|
this.typedrouter.addTypedHandler<plugins.idpInterfaces.request.IReq_GetRolesAndOrganizationsForUserId>(
|
||||||
new plugins.typedrequest.TypedHandler('getRolesAndOrganizationsForUserId', async reqArg => {
|
new plugins.typedrequest.TypedHandler('getRolesAndOrganizationsForUserId', async reqArg => {
|
||||||
|
console.log('user manager: getting roles and orgs');
|
||||||
const user = await this.getUserByJwtValidation(reqArg.jwt);
|
const user = await this.getUserByJwtValidation(reqArg.jwt);
|
||||||
const organizations = await this.receptionRef.organizationmanager.getAllOrganizationsForUser(
|
const organizations = await this.receptionRef.organizationmanager.getAllOrganizationsForUser(
|
||||||
user
|
user
|
||||||
@@ -32,6 +33,29 @@ export class UserManager {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
this.typedrouter.addTypedHandler<plugins.idpInterfaces.request.IReq_WhoIs>(
|
||||||
|
new plugins.typedrequest.TypedHandler('whoIs', async reqArg => {
|
||||||
|
const user = await this.getUserByJwtValidation(reqArg.jwt);
|
||||||
|
if (!user) {
|
||||||
|
throw new plugins.typedrequest.TypedResponseError('User not found');
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
user: {
|
||||||
|
id: user.id,
|
||||||
|
data: {
|
||||||
|
name: user.data.name,
|
||||||
|
username: user.data.username,
|
||||||
|
email: user.data.email,
|
||||||
|
mobileNumber: user.data.mobileNumber,
|
||||||
|
connectedOrgs: user.data.connectedOrgs,
|
||||||
|
status: null,
|
||||||
|
password: null,
|
||||||
|
} as plugins.idpInterfaces.data.IUser['data']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,7 +74,7 @@ export class UserManager {
|
|||||||
* faster than the "getUserByJwt"
|
* faster than the "getUserByJwt"
|
||||||
*/
|
*/
|
||||||
public async getUserByJwtValidation(jwtStringArg: string) {
|
public async getUserByJwtValidation(jwtStringArg: string) {
|
||||||
const jwtDataArg: plugins.lointReception.data.IJwt = await this.receptionRef.jwtManager.smartjwtInstance.verifyJWTAndGetData(jwtStringArg);
|
const jwtDataArg: plugins.idpInterfaces.data.IJwt = await this.receptionRef.jwtManager.smartjwtInstance.verifyJWTAndGetData(jwtStringArg);
|
||||||
const resultingUser = await this.CUser.getInstance({
|
const resultingUser = await this.CUser.getInstance({
|
||||||
id: jwtDataArg.data.userId
|
id: jwtDataArg.data.userId
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,19 +4,19 @@ import * as plugins from './plugins.js';
|
|||||||
export class IdpClient {
|
export class IdpClient {
|
||||||
// INSTANCE PRIVATE
|
// INSTANCE PRIVATE
|
||||||
private helpers = {
|
private helpers = {
|
||||||
async extractDataFromJwtString(jwtString: string): Promise<plugins.lointReception.data.IJwt> {
|
async extractDataFromJwtString(jwtString: string): Promise<plugins.idpInterfaces.data.IJwt> {
|
||||||
return plugins.webjwt.getDataFromJwtString(jwtString);
|
return plugins.webjwt.getDataFromJwtString(jwtString);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// INSTANCE PUBLIC
|
// INSTANCE PUBLIC
|
||||||
|
|
||||||
public appData: plugins.lointReception.data.IApp;
|
public appData: plugins.idpInterfaces.data.IApp;
|
||||||
public rolesReplaySubject = new plugins.smartrx.rxjs.ReplaySubject(1);
|
public rolesReplaySubject = new plugins.smartrx.rxjs.ReplaySubject(1);
|
||||||
public organizationsReplaySubject = new plugins.smartrx.rxjs.ReplaySubject(1);
|
public organizationsReplaySubject = new plugins.smartrx.rxjs.ReplaySubject(1);
|
||||||
|
|
||||||
public parsedReceptionUrl: plugins.smarturl.Smarturl;
|
public parsedReceptionUrl: plugins.smarturl.Smarturl;
|
||||||
constructor(receptionBaseUrlArg: string, appDataArg?: plugins.lointReception.data.IApp) {
|
constructor(receptionBaseUrlArg: string, appDataArg?: plugins.idpInterfaces.data.IApp) {
|
||||||
if (receptionBaseUrlArg.endsWith('/')) {
|
if (receptionBaseUrlArg.endsWith('/')) {
|
||||||
receptionBaseUrlArg = receptionBaseUrlArg.slice(0, -1);
|
receptionBaseUrlArg = receptionBaseUrlArg.slice(0, -1);
|
||||||
}
|
}
|
||||||
@@ -78,26 +78,26 @@ export class IdpClient {
|
|||||||
public typedrouter = new plugins.typedrequest.TypedRouter();
|
public typedrouter = new plugins.typedrequest.TypedRouter();
|
||||||
|
|
||||||
public statusObservable =
|
public statusObservable =
|
||||||
new plugins.smartrx.rxjs.Subject<plugins.lointReception.data.TLoginStatus>();
|
new plugins.smartrx.rxjs.Subject<plugins.idpInterfaces.data.TLoginStatus>();
|
||||||
|
|
||||||
public ssoStore = new plugins.webstore.WebStore({
|
public ssoStore = new plugins.webstore.WebStore({
|
||||||
storeName: 'wgsso',
|
storeName: 'idpglobalStore',
|
||||||
dbName: 'wgsso',
|
dbName: 'main',
|
||||||
});
|
});
|
||||||
|
|
||||||
public async storeJwt(jwtString: string) {
|
public async storeJwt(jwtString: string) {
|
||||||
await this.ssoStore.set('wgJwt', jwtString);
|
await this.ssoStore.set('idpJwt', jwtString);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getJwt(): Promise<string> {
|
public async getJwt(): Promise<string> {
|
||||||
return await this.ssoStore.get('wgJwt');
|
return await this.ssoStore.get('idpJwt');
|
||||||
}
|
}
|
||||||
public async getJwtData(): Promise<plugins.lointReception.data.IJwt> {
|
public async getJwtData(): Promise<plugins.idpInterfaces.data.IJwt> {
|
||||||
return this.helpers.extractDataFromJwtString(await this.getJwt());
|
return this.helpers.extractDataFromJwtString(await this.getJwt());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async deleteJwt() {
|
public async deleteJwt() {
|
||||||
await this.ssoStore.delete('wgJwt');
|
await this.ssoStore.delete('idpJwt');
|
||||||
console.log('removed jwt');
|
console.log('removed jwt');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,13 +121,13 @@ export class IdpClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async refreshJwt(refreshTokenArg?: string): Promise<string> {
|
public async refreshJwt(refreshTokenArg?: string): Promise<string> {
|
||||||
let extractedJwt: plugins.lointReception.data.IJwt;
|
let extractedJwt: plugins.idpInterfaces.data.IJwt;
|
||||||
|
|
||||||
if (!refreshTokenArg) {
|
if (!refreshTokenArg) {
|
||||||
extractedJwt = await this.helpers.extractDataFromJwtString(await this.getJwt());
|
extractedJwt = await this.helpers.extractDataFromJwtString(await this.getJwt());
|
||||||
}
|
}
|
||||||
const refreshJwtReq =
|
const refreshJwtReq =
|
||||||
new plugins.typedrequest.TypedRequest<plugins.lointReception.request.IReq_RefreshJwt>(
|
new plugins.typedrequest.TypedRequest<plugins.idpInterfaces.request.IReq_RefreshJwt>(
|
||||||
this.parsedReceptionUrl.toString(),
|
this.parsedReceptionUrl.toString(),
|
||||||
'refreshJwt'
|
'refreshJwt'
|
||||||
);
|
);
|
||||||
@@ -146,11 +146,11 @@ export class IdpClient {
|
|||||||
/**
|
/**
|
||||||
* can be used to switch between pages
|
* can be used to switch between pages
|
||||||
*/
|
*/
|
||||||
public async getTransferToken(appDataArg?: plugins.lointReception.data.IApp): Promise<string> {
|
public async getTransferToken(appDataArg?: plugins.idpInterfaces.data.IApp): Promise<string> {
|
||||||
const jwt = await this.performJwtHousekeeping();
|
const jwt = await this.performJwtHousekeeping();
|
||||||
const extractedJwt = await this.helpers.extractDataFromJwtString(jwt);
|
const extractedJwt = await this.helpers.extractDataFromJwtString(jwt);
|
||||||
const getTransferToken =
|
const getTransferToken =
|
||||||
new plugins.typedrequest.TypedRequest<plugins.lointReception.request.IReq_ExchangeRefreshTokenAndTransferToken>(
|
new plugins.typedrequest.TypedRequest<plugins.idpInterfaces.request.IReq_ExchangeRefreshTokenAndTransferToken>(
|
||||||
this.parsedReceptionUrl.toString(),
|
this.parsedReceptionUrl.toString(),
|
||||||
'exchangeRefreshTokenAndTransferToken'
|
'exchangeRefreshTokenAndTransferToken'
|
||||||
);
|
);
|
||||||
@@ -188,7 +188,7 @@ export class IdpClient {
|
|||||||
const transferToken = url.searchParams['transfertoken'];
|
const transferToken = url.searchParams['transfertoken'];
|
||||||
if (transferToken) {
|
if (transferToken) {
|
||||||
const getTransferToken =
|
const getTransferToken =
|
||||||
new plugins.typedrequest.TypedRequest<plugins.lointReception.request.IReq_ExchangeRefreshTokenAndTransferToken>(
|
new plugins.typedrequest.TypedRequest<plugins.idpInterfaces.request.IReq_ExchangeRefreshTokenAndTransferToken>(
|
||||||
this.parsedReceptionUrl.toString(),
|
this.parsedReceptionUrl.toString(),
|
||||||
'exchangeRefreshTokenAndTransferToken'
|
'exchangeRefreshTokenAndTransferToken'
|
||||||
);
|
);
|
||||||
@@ -219,7 +219,8 @@ export class IdpClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* forces the current user to login
|
* determines if the user is logged in
|
||||||
|
* accepts boolean to optionally require login
|
||||||
* @param requireLoginArg
|
* @param requireLoginArg
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
@@ -256,22 +257,17 @@ export class IdpClient {
|
|||||||
* logs out the current user
|
* logs out the current user
|
||||||
*/
|
*/
|
||||||
public async logout() {
|
public async logout() {
|
||||||
const urlInstance = plugins.smarturl.Smarturl.createFromUrl('https://sso.workspace.global/', {
|
const idpLogoutUrl = this.parsedReceptionUrl.clone().set('path', '/logout');
|
||||||
searchParams: {
|
if (!globalThis.location.href.startsWith(idpLogoutUrl.origin)) {
|
||||||
appdata: plugins.smartjson.stringifyBase64(this.appData),
|
|
||||||
action: 'logout',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
if (!globalThis.location.href.startsWith('https://sso.workspace.global/')) {
|
|
||||||
// we are somewhere in an app
|
// we are somewhere in an app
|
||||||
await this.deleteJwt();
|
await this.deleteJwt();
|
||||||
globalThis.location.href = urlInstance.toString();
|
globalThis.location.href = idpLogoutUrl.toString();
|
||||||
} else {
|
} else {
|
||||||
// we are in the sso page
|
// we are in the sso page
|
||||||
await this.enableTypedSocket();
|
await this.enableTypedSocket();
|
||||||
console.log(`logging out against ${this.parsedReceptionUrl.toString()}`);
|
console.log(`logging out against ${this.parsedReceptionUrl.toString()}`);
|
||||||
const logoutTr =
|
const logoutTr =
|
||||||
this.typedsocket.createTypedRequest<plugins.lointReception.request.ILogoutRequest>(
|
this.typedsocket.createTypedRequest<plugins.idpInterfaces.request.ILogoutRequest>(
|
||||||
'logout'
|
'logout'
|
||||||
);
|
);
|
||||||
await logoutTr.fire({
|
await logoutTr.fire({
|
||||||
@@ -285,6 +281,9 @@ export class IdpClient {
|
|||||||
} else {
|
} else {
|
||||||
console.error('no appData provided. Not redirecting after logout.');
|
console.error('no appData provided. Not redirecting after logout.');
|
||||||
}
|
}
|
||||||
|
if (window.location.href.startsWith(idpLogoutUrl.origin)) {
|
||||||
|
window.location.href = this.parsedReceptionUrl.origin;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -316,7 +315,7 @@ export class IdpClient {
|
|||||||
) {
|
) {
|
||||||
await this.typedsocketDeferred.promise;
|
await this.typedsocketDeferred.promise;
|
||||||
const validateOrg =
|
const validateOrg =
|
||||||
this.typedsocket.createTypedRequest<plugins.lointReception.request.IReq_CreateOrganization>(
|
this.typedsocket.createTypedRequest<plugins.idpInterfaces.request.IReq_CreateOrganization>(
|
||||||
'createOrganization'
|
'createOrganization'
|
||||||
);
|
);
|
||||||
const response = await validateOrg.fire({
|
const response = await validateOrg.fire({
|
||||||
@@ -333,9 +332,10 @@ export class IdpClient {
|
|||||||
* gets the current OrganizationRoles
|
* gets the current OrganizationRoles
|
||||||
*/
|
*/
|
||||||
public async getRolesAndOrganizations() {
|
public async getRolesAndOrganizations() {
|
||||||
|
console.log('idpclient: getting roles and orgs...');
|
||||||
await this.typedsocketDeferred.promise;
|
await this.typedsocketDeferred.promise;
|
||||||
const rolesAndOrganizationsForUserId =
|
const rolesAndOrganizationsForUserId =
|
||||||
this.typedsocket.createTypedRequest<plugins.lointReception.request.IReq_GetRolesAndOrganizationsForUserId>(
|
this.typedsocket.createTypedRequest<plugins.idpInterfaces.request.IReq_GetRolesAndOrganizationsForUserId>(
|
||||||
'getRolesAndOrganizationsForUserId'
|
'getRolesAndOrganizationsForUserId'
|
||||||
);
|
);
|
||||||
const response = await rolesAndOrganizationsForUserId.fire({
|
const response = await rolesAndOrganizationsForUserId.fire({
|
||||||
@@ -351,7 +351,7 @@ export class IdpClient {
|
|||||||
public async updatePaddleCheckoutId(orgIdArg: string, checkoutIdArg: string) {
|
public async updatePaddleCheckoutId(orgIdArg: string, checkoutIdArg: string) {
|
||||||
await this.typedsocketDeferred.promise;
|
await this.typedsocketDeferred.promise;
|
||||||
const updateBillingPlan =
|
const updateBillingPlan =
|
||||||
this.typedsocket.createTypedRequest<plugins.lointReception.request.IReq_UpdatePaymentMethod>(
|
this.typedsocket.createTypedRequest<plugins.idpInterfaces.request.IReq_UpdatePaymentMethod>(
|
||||||
'updatePaymentMethod'
|
'updatePaymentMethod'
|
||||||
);
|
);
|
||||||
const response = await updateBillingPlan.fire({
|
const response = await updateBillingPlan.fire({
|
||||||
@@ -363,4 +363,16 @@ export class IdpClient {
|
|||||||
});
|
});
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async whoIs() {
|
||||||
|
await this.typedsocketDeferred.promise;
|
||||||
|
const whoIs =
|
||||||
|
this.typedsocket.createTypedRequest<plugins.idpInterfaces.request.IReq_WhoIs>(
|
||||||
|
'whoIs'
|
||||||
|
);
|
||||||
|
const response = await whoIs.fire({
|
||||||
|
jwt: await this.getJwt(),
|
||||||
|
});
|
||||||
|
return response;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,21 +11,21 @@ export class IdpRequests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public get afterRegistrationEmailClicked () {
|
public get afterRegistrationEmailClicked () {
|
||||||
return new plugins.typedrequest.TypedRequest<plugins.lointReception.request.IReq_AfterRegistrationEmailClicked>(
|
return new plugins.typedrequest.TypedRequest<plugins.idpInterfaces.request.IReq_AfterRegistrationEmailClicked>(
|
||||||
this.idpClientArg.parsedReceptionUrl.toString(),
|
this.idpClientArg.parsedReceptionUrl.toString(),
|
||||||
'afterRegistrationEmailClicked'
|
'afterRegistrationEmailClicked'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public get setData() {
|
public get setData() {
|
||||||
return new plugins.typedrequest.TypedRequest<plugins.lointReception.request.IReq_SetDataForRegistration>(
|
return new plugins.typedrequest.TypedRequest<plugins.idpInterfaces.request.IReq_SetDataForRegistration>(
|
||||||
this.idpClientArg.parsedReceptionUrl.toString(),
|
this.idpClientArg.parsedReceptionUrl.toString(),
|
||||||
'setDataForRegistration'
|
'setDataForRegistration'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public get mobileNumberVerification () {
|
public get mobileNumberVerification () {
|
||||||
return new plugins.typedrequest.TypedRequest<plugins.lointReception.request.IReq_MobileVerificationForRegistration>(
|
return new plugins.typedrequest.TypedRequest<plugins.idpInterfaces.request.IReq_MobileVerificationForRegistration>(
|
||||||
this.idpClientArg.parsedReceptionUrl.toString(),
|
this.idpClientArg.parsedReceptionUrl.toString(),
|
||||||
'mobileVerificationForRegistration'
|
'mobileVerificationForRegistration'
|
||||||
);
|
);
|
||||||
@@ -33,28 +33,28 @@ export class IdpRequests {
|
|||||||
|
|
||||||
|
|
||||||
public get finishRegistration() {
|
public get finishRegistration() {
|
||||||
return new plugins.typedrequest.TypedRequest<plugins.lointReception.request.IReq_FinishRegistration>(
|
return new plugins.typedrequest.TypedRequest<plugins.idpInterfaces.request.IReq_FinishRegistration>(
|
||||||
this.idpClientArg.parsedReceptionUrl.toString(),
|
this.idpClientArg.parsedReceptionUrl.toString(),
|
||||||
'finishRegistration'
|
'finishRegistration'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public get loginWithUserNameAndPassword () {
|
public get loginWithUserNameAndPassword () {
|
||||||
return new plugins.typedrequest.TypedRequest<plugins.lointReception.request.IReq_LoginWithEmailOrUsernameAndPassword>(
|
return new plugins.typedrequest.TypedRequest<plugins.idpInterfaces.request.IReq_LoginWithEmailOrUsernameAndPassword>(
|
||||||
this.idpClientArg.parsedReceptionUrl.toString(),
|
this.idpClientArg.parsedReceptionUrl.toString(),
|
||||||
'loginWithEmailOrUsernameAndPassword'
|
'loginWithEmailOrUsernameAndPassword'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public get obtainJwt () {
|
public get obtainJwt () {
|
||||||
return new plugins.typedrequest.TypedRequest<plugins.lointReception.request.IReq_RefreshJwt>(
|
return new plugins.typedrequest.TypedRequest<plugins.idpInterfaces.request.IReq_RefreshJwt>(
|
||||||
this.idpClientArg.parsedReceptionUrl.toString(),
|
this.idpClientArg.parsedReceptionUrl.toString(),
|
||||||
'refreshJwt'
|
'refreshJwt'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public get obtainOneTimeToken () {
|
public get obtainOneTimeToken () {
|
||||||
return new plugins.typedrequest.TypedRequest<plugins.lointReception.request.IReq_ExchangeRefreshTokenAndTransferToken>(
|
return new plugins.typedrequest.TypedRequest<plugins.idpInterfaces.request.IReq_ExchangeRefreshTokenAndTransferToken>(
|
||||||
this.idpClientArg.parsedReceptionUrl.toString(),
|
this.idpClientArg.parsedReceptionUrl.toString(),
|
||||||
'exchangeRefreshTokenAndTransferToken'
|
'exchangeRefreshTokenAndTransferToken'
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// losslessone_private scope
|
// losslessone_private scope
|
||||||
import * as lointReception from '../dist_ts_interfaces/index.js';
|
import * as idpInterfaces from '../dist_ts_interfaces/index.js';
|
||||||
|
|
||||||
export { lointReception };
|
export { idpInterfaces };
|
||||||
|
|
||||||
// apiglobal scope
|
// apiglobal scope
|
||||||
import * as typedrequest from '@api.global/typedrequest';
|
import * as typedrequest from '@api.global/typedrequest';
|
||||||
|
|||||||
@@ -74,3 +74,13 @@ export interface IReq_GetRolesAndOrganizationsForUserId
|
|||||||
organizations: data.IOrganization[];
|
organizations: data.IOrganization[];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IReq_WhoIs {
|
||||||
|
method: 'whoIs';
|
||||||
|
request: {
|
||||||
|
jwt: string;
|
||||||
|
};
|
||||||
|
response: {
|
||||||
|
user: data.IUser;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@idp.global/idp.global',
|
name: '@idp.global/idp.global',
|
||||||
version: '1.2.1',
|
version: '1.4.3',
|
||||||
description: 'An identity provider software managing user authentications, registrations, and sessions.'
|
description: 'An identity provider software managing user authentications, registrations, and sessions.'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,141 @@
|
|||||||
|
import * as plugins from '../../plugins.js';
|
||||||
|
|
||||||
|
import {
|
||||||
|
customElement,
|
||||||
|
DeesElement,
|
||||||
|
property,
|
||||||
|
html,
|
||||||
|
cssManager,
|
||||||
|
unsafeCSS,
|
||||||
|
css,
|
||||||
|
type TemplateResult
|
||||||
|
} from '@design.estate/dees-element';
|
||||||
|
|
||||||
|
import { LeleAccountNavigation } from './navigation.js';
|
||||||
|
|
||||||
|
import * as views from './views/index.js';
|
||||||
|
import * as accountstate from '../../states/accountstate.js';
|
||||||
|
|
||||||
|
import { commitinfo } from '../../../dist_ts/00_commitinfo_data.js';
|
||||||
|
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
'idp-accountcontent': IdpAccountContent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@customElement('idp-accountcontent')
|
||||||
|
export class IdpAccountContent extends DeesElement {
|
||||||
|
|
||||||
|
public subrouter: plugins.deesDomtools.plugins.smartrouter.SmartRouter;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static styles = [
|
||||||
|
cssManager.defaultStyles,
|
||||||
|
css`
|
||||||
|
:host {
|
||||||
|
display: block;
|
||||||
|
color: #fff;
|
||||||
|
padding-top: 10px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
background: ${cssManager.bdTheme('#eeeeeb', '#000000')}
|
||||||
|
}
|
||||||
|
:host([hidden]) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.main {
|
||||||
|
position: absolute;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
lele-accountnavigation {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0px;
|
||||||
|
left: 0px;
|
||||||
|
height: 100vh;
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
.viewcontainer {
|
||||||
|
will-change: transform;
|
||||||
|
position: absolute;
|
||||||
|
right: 0px;
|
||||||
|
bottom: 0px;
|
||||||
|
width: calc(100vw - 200px);
|
||||||
|
height: 100vh;
|
||||||
|
overflow-y: scroll;
|
||||||
|
overscroll-behavior: contain;
|
||||||
|
transition: all 0.3s;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.viewcontainer.changing {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(20px);
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
];
|
||||||
|
|
||||||
|
public render(): TemplateResult {
|
||||||
|
return html`
|
||||||
|
<style></style>
|
||||||
|
<div class="main">
|
||||||
|
<lele-accountnavigation></lele-accountnavigation>
|
||||||
|
<div class="viewcontainer">
|
||||||
|
<!--<lele-accountview-subscription></lele-accountview-subscription>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async firstUpdated(_changedProperties: Map<string | number | symbol, unknown>): Promise<void> {
|
||||||
|
super.firstUpdated(_changedProperties);
|
||||||
|
await this.domtoolsPromise;
|
||||||
|
this.subrouter = this.domtools.router.createSubRouter('/account');
|
||||||
|
const viewcontainer: HTMLDivElement = this.shadowRoot.querySelector('.viewcontainer');
|
||||||
|
|
||||||
|
const cleanupViews = async () => {
|
||||||
|
for (const child of Array.from(viewcontainer.children)) {
|
||||||
|
viewcontainer.removeChild(child);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
viewcontainer.append(new views.BaseView());
|
||||||
|
console.log(`loaded base view`);
|
||||||
|
|
||||||
|
this.subrouter.on('', async () => {
|
||||||
|
viewcontainer.classList.add('changing');
|
||||||
|
await this.domtools.convenience.smartdelay.delayFor(300);
|
||||||
|
console.log('We are viewing the account overview');
|
||||||
|
await cleanupViews();
|
||||||
|
viewcontainer.append(new views.BaseView());
|
||||||
|
viewcontainer.classList.remove('changing');
|
||||||
|
await this.domtools.convenience.smartdelay.delayFor(300);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.subrouter.on('/org/:orgName/billing', async () => {
|
||||||
|
viewcontainer.classList.add('changing');
|
||||||
|
await this.domtools.convenience.smartdelay.delayFor(300);
|
||||||
|
console.log('We are viewing the billing page');
|
||||||
|
await cleanupViews();
|
||||||
|
viewcontainer.append(new views.SubscriptionView());
|
||||||
|
viewcontainer.classList.remove('changing');
|
||||||
|
await this.domtools.convenience.smartdelay.delayFor(300);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.subrouter._handleRouteState();
|
||||||
|
|
||||||
|
this.registerGarbageFunction(async () => {
|
||||||
|
this.subrouter.destroy();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export * from './content.js';
|
||||||
|
export * from './navigation.js';
|
||||||
@@ -0,0 +1,223 @@
|
|||||||
|
import {
|
||||||
|
customElement,
|
||||||
|
DeesElement,
|
||||||
|
property,
|
||||||
|
html,
|
||||||
|
cssManager,
|
||||||
|
unsafeCSS,
|
||||||
|
css,
|
||||||
|
type TemplateResult,
|
||||||
|
subscribe,
|
||||||
|
} from '@design.estate/dees-element';
|
||||||
|
|
||||||
|
import * as plugins from '../../plugins.js';
|
||||||
|
import * as states from '../../states/accountstate.js';
|
||||||
|
import { IdpState } from '../../states/idp.state.js';
|
||||||
|
|
||||||
|
import { commitinfo } from '../../../dist_ts/00_commitinfo_data.js';
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
'lele-accountnavigation': LeleAccountNavigation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@customElement('lele-accountnavigation')
|
||||||
|
export class LeleAccountNavigation extends DeesElement {
|
||||||
|
@property()
|
||||||
|
public options: { text: string; id: string }[] = [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
text: 'Apps',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '2',
|
||||||
|
text: 'Users',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '3',
|
||||||
|
text: 'Activity',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '4',
|
||||||
|
text: 'Billing & Subscription',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static styles = [
|
||||||
|
cssManager.defaultStyles,
|
||||||
|
css`
|
||||||
|
:host {
|
||||||
|
display: block;
|
||||||
|
color: ${cssManager.bdTheme('#333', '#fff')};
|
||||||
|
padding: 10px;
|
||||||
|
padding-left: 0px;
|
||||||
|
background: ${cssManager.bdTheme('#eeeeeb', '#000')};
|
||||||
|
border-right: ${cssManager.bdTheme('1px solid #ccc', '1px solid #111')};
|
||||||
|
}
|
||||||
|
:host([hidden]) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
font-family: 'Cal Sans';
|
||||||
|
letter-spacing: 0.0125em;
|
||||||
|
font-size: 16px;
|
||||||
|
text-align: center;
|
||||||
|
padding: 16px 0px 16px 0px;
|
||||||
|
margin: -8px -8px -16px 0px;
|
||||||
|
border-bottom: 1px solid #111111;
|
||||||
|
cursor: default;
|
||||||
|
position: relative;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo:hover {
|
||||||
|
background: ${unsafeCSS(plugins.deesCatalog.colors.dark.blue)};
|
||||||
|
}
|
||||||
|
|
||||||
|
.commitinfo {
|
||||||
|
text-align: center;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0px;
|
||||||
|
left: 0px;
|
||||||
|
font-family: 'Intel One Mono';
|
||||||
|
width: 100%;
|
||||||
|
font-size: 12px;
|
||||||
|
padding: 8px;
|
||||||
|
border-top: ${cssManager.bdTheme('1px solid #ccc', '1px solid #333')};
|
||||||
|
color: ${cssManager.bdTheme('#666', '#ccc')};
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigationGroupLabel {
|
||||||
|
width: min-content;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 300;
|
||||||
|
border-bottom: 1px solid;
|
||||||
|
border-image: linear-gradient(to right, orange, #44444400) 1;
|
||||||
|
color: ${cssManager.bdTheme('#666', '#ccc')};
|
||||||
|
margin-bottom: 5px;
|
||||||
|
padding-top: 32px;
|
||||||
|
padding-left: 10px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigationOption {
|
||||||
|
border-top-right-radius: 30px;
|
||||||
|
border-bottom-right-radius: 30px;
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 8px;
|
||||||
|
padding-left: 10px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigationOption:hover {
|
||||||
|
cursor: default;
|
||||||
|
background: ${cssManager.bdTheme('#bbb', plugins.deesCatalog.colors.dark.blue)};
|
||||||
|
}
|
||||||
|
dees-input-dropdown {
|
||||||
|
margin-top: 16px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
];
|
||||||
|
|
||||||
|
public async getAccountRouter() {
|
||||||
|
const host = (this.getRootNode() as any).host;
|
||||||
|
return (host as any).subrouter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public render(): TemplateResult {
|
||||||
|
return html`
|
||||||
|
<style></style>
|
||||||
|
<div class="commitinfo">idp.global v${commitinfo.version}</div>
|
||||||
|
<div class="logo">idp.global</div>
|
||||||
|
<div class="navigationGroupLabel">Account Settings</div>
|
||||||
|
<div
|
||||||
|
class="navigationOption"
|
||||||
|
@click=${async () => {
|
||||||
|
const subrouter = await this.getAccountRouter();
|
||||||
|
subrouter.pushUrl('');
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
overview
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="navigationOption"
|
||||||
|
@click=${async () => {
|
||||||
|
const idpState = await IdpState.getSingletonInstance();
|
||||||
|
idpState.domtools.router.pushUrl('/logout');
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
logout
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="navigationOption"
|
||||||
|
@click=${async () => {
|
||||||
|
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
manage roles
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="navigationOption"
|
||||||
|
@click=${async () => {
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
create an org
|
||||||
|
</div>
|
||||||
|
<div class="navigationGroupLabel">Organization Settings</div>
|
||||||
|
<dees-input-dropdown
|
||||||
|
.label=${'choose org:'}
|
||||||
|
@selectedOption=${(eventArg: CustomEvent) => {
|
||||||
|
const currentState = states.accountState.getState();
|
||||||
|
states.accountState.dispatchAction(
|
||||||
|
states.setSelectedOrg,
|
||||||
|
currentState.organizations.find((org) => org.data.slug === eventArg.detail.payload)
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
></dees-input-dropdown>
|
||||||
|
${this.options.map((option) => {
|
||||||
|
return html` <div class="navigationOption">${option.text}</div> `;
|
||||||
|
})}
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
public firstUpdated() {
|
||||||
|
const deesInputDropdown = this.shadowRoot.querySelector('dees-input-dropdown');
|
||||||
|
const orgToMenuEntry = (orgArg?: plugins.idpInterfaces.data.IOrganization) => {
|
||||||
|
if (!orgArg) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
option: orgArg.data.name,
|
||||||
|
key: orgArg.data.slug,
|
||||||
|
payload: orgArg.data.slug,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
states.accountState
|
||||||
|
.select((stateArg) => stateArg.organizations)
|
||||||
|
.pipe(
|
||||||
|
plugins.deesDomtools.plugins.smartrx.rxjs.ops.map((orgArrayArg) => {
|
||||||
|
return orgArrayArg.map(orgToMenuEntry);
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.subscribe((menuEntries) => {
|
||||||
|
deesInputDropdown.options = menuEntries;
|
||||||
|
});
|
||||||
|
states.accountState
|
||||||
|
.select((stateArg) => stateArg.selectedOrg)
|
||||||
|
.pipe(plugins.deesDomtools.plugins.smartrx.rxjs.ops.map(orgToMenuEntry))
|
||||||
|
.subscribe((selectedOrgArg) => {
|
||||||
|
deesInputDropdown.selectedOption = selectedOrgArg;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import { css } from '@design.estate/dees-element';
|
||||||
|
|
||||||
|
export default css`
|
||||||
|
h1 {
|
||||||
|
margin-top: 50px;
|
||||||
|
border-bottom: 1px solid;
|
||||||
|
border-image: radial-gradient(rgba(136, 136, 136, 0.44), rgba(136, 136, 136, 0)) 1 / 1 / 0 stretch;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
border-top: 1px dotted #666;
|
||||||
|
padding-top: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
line-height: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
dees-button {
|
||||||
|
margin-top: 16px;
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
dees-input-text {
|
||||||
|
max-width: 400px;
|
||||||
|
}
|
||||||
|
`;
|
||||||
@@ -0,0 +1,193 @@
|
|||||||
|
import * as plugins from '../../../plugins.js';
|
||||||
|
import {
|
||||||
|
customElement,
|
||||||
|
DeesElement,
|
||||||
|
property,
|
||||||
|
html,
|
||||||
|
cssManager,
|
||||||
|
unsafeCSS,
|
||||||
|
css,
|
||||||
|
render,
|
||||||
|
subscribe,
|
||||||
|
} from '@design.estate/dees-element';
|
||||||
|
|
||||||
|
import sharedStyles from '../sharedstyles.js';
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
'lele-accountview-baseview': BaseView;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
import * as state from '../../../states/accountstate.js';
|
||||||
|
|
||||||
|
@customElement('lele-accountview-baseview')
|
||||||
|
export class BaseView extends DeesElement {
|
||||||
|
@property({
|
||||||
|
type: Array,
|
||||||
|
})
|
||||||
|
subscriptions: any[] = [
|
||||||
|
{
|
||||||
|
organization: 'org1',
|
||||||
|
'subscription type': 'workspace.global SaaS',
|
||||||
|
price: '4€',
|
||||||
|
userFactor: 4,
|
||||||
|
total: '16.00€',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
organization: 'org1',
|
||||||
|
'subscription type': 'workspace.global IaaS Base Access',
|
||||||
|
price: '0€',
|
||||||
|
userFactor: 4,
|
||||||
|
total: '0€',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
organization: 'org1',
|
||||||
|
'subscription type': 'workspace.global SLA Senior',
|
||||||
|
price: '2000€',
|
||||||
|
userFactor: 'none',
|
||||||
|
total: '2000.00€',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
public static styles = [
|
||||||
|
cssManager.defaultStyles,
|
||||||
|
sharedStyles,
|
||||||
|
css`
|
||||||
|
:host {
|
||||||
|
display: block;
|
||||||
|
max-width: 900px;
|
||||||
|
margin: auto;
|
||||||
|
color: ${cssManager.bdTheme('#333', '#fff')};
|
||||||
|
}
|
||||||
|
.slug {
|
||||||
|
color: orange;
|
||||||
|
}
|
||||||
|
|
||||||
|
.orgGrid {
|
||||||
|
display: grid;
|
||||||
|
grid-gap: 16px;
|
||||||
|
grid-template-columns: ${cssManager.cssGridColumns(2, 16)};
|
||||||
|
}
|
||||||
|
|
||||||
|
.org {
|
||||||
|
padding: 16px;
|
||||||
|
border-top: 1px solid #444;
|
||||||
|
background: ${cssManager.bdTheme('#ccc', '#222')};
|
||||||
|
border-radius: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.org:hover {
|
||||||
|
cursor: default;
|
||||||
|
background: ${cssManager.bdTheme('#CCC', '#333')};
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
];
|
||||||
|
|
||||||
|
public render() {
|
||||||
|
return html`
|
||||||
|
<div class="viewHost">
|
||||||
|
|
||||||
|
</div> `;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async firstUpdated(_changedProperties: Map<string | number | symbol, unknown>) {
|
||||||
|
await this.domtoolsPromise;
|
||||||
|
super.firstUpdated(_changedProperties);
|
||||||
|
const viewHost: HTMLDivElement = this.shadowRoot.querySelector('.viewHost');
|
||||||
|
await state.accountState.dispatchAction(state.getOrganizationsAction, null);
|
||||||
|
console.log('got orgs');
|
||||||
|
if (state.accountState.getState().organizations.length === 0) {
|
||||||
|
render(
|
||||||
|
html`
|
||||||
|
<h1>Setup Your Account</h1>
|
||||||
|
<p>
|
||||||
|
There are no organizations for your account. Please create one now. Alternatively you
|
||||||
|
can ask an admin of an existing organization to invite you.
|
||||||
|
</p>
|
||||||
|
<dees-form>
|
||||||
|
<dees-input-text .label=${'Organization Name'} .key=${'orgName'}></dees-input-text>
|
||||||
|
</dees-form>
|
||||||
|
<p>
|
||||||
|
The organization slug corresponds to the organization name:<br />
|
||||||
|
<span class="slug"
|
||||||
|
>${subscribe(
|
||||||
|
state.accountState.select((stateArg) => stateArg.newOrg.chosenSlug)
|
||||||
|
)}</span
|
||||||
|
>
|
||||||
|
</p>
|
||||||
|
<span class="hint"></span>
|
||||||
|
<dees-button .disabled=${true}>Create the Organization</dees-button>
|
||||||
|
`,
|
||||||
|
viewHost
|
||||||
|
);
|
||||||
|
const subscriptions: plugins.deesDomtools.plugins.smartrx.rxjs.Subscription[] = [];
|
||||||
|
const form = this.shadowRoot.querySelector('dees-form');
|
||||||
|
const orgInput = this.shadowRoot.querySelector('dees-input-text');
|
||||||
|
const hint = this.shadowRoot.querySelector('.hint');
|
||||||
|
const button = this.shadowRoot.querySelector('dees-button');
|
||||||
|
const newOrgSubscription = state.accountState
|
||||||
|
.select((stateArg) => stateArg.newOrg)
|
||||||
|
.subscribe((data) => {
|
||||||
|
if (data.chosenSlug) {
|
||||||
|
hint.innerHTML = 'Waiting: Validating...';
|
||||||
|
} else {
|
||||||
|
hint.innerHTML = 'Hint: Enter a valid organization name.';
|
||||||
|
}
|
||||||
|
if (data.validated && data.validationOk) {
|
||||||
|
hint.innerHTML =
|
||||||
|
'Success: Name is available. Please click the button to create the organization.';
|
||||||
|
button.disabled = false;
|
||||||
|
} else if (!data.validated || !data.validationOk) {
|
||||||
|
hint.innerHTML = `Info: Name not available. Please choose another one.`;
|
||||||
|
button.disabled = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
subscriptions.push(newOrgSubscription);
|
||||||
|
|
||||||
|
const formSubscription = form.changeSubject.subscribe(async (dataArg: any) => {
|
||||||
|
await state.accountState.dispatchAction(state.setNewOrgName, dataArg.orgName);
|
||||||
|
});
|
||||||
|
subscriptions.push(formSubscription);
|
||||||
|
button.addEventListener('clicked', async () => {
|
||||||
|
orgInput.disabled = true;
|
||||||
|
button.text = 'creating org...';
|
||||||
|
button.status = 'pending';
|
||||||
|
hint.innerHTML = 'Waiting for creation of the organization...';
|
||||||
|
await state.accountState.dispatchAction(state.manifestNewOrgName, null);
|
||||||
|
hint.innerHTML = `The Organization with name ${
|
||||||
|
state.accountState.getState().organizations[0].data.name
|
||||||
|
} has been created!`;
|
||||||
|
button.text = 'created!';
|
||||||
|
button.status = 'success';
|
||||||
|
const parentElement = (this.getRootNode() as any).host;
|
||||||
|
parentElement.subrouter.pushUrl(
|
||||||
|
`/org/${state.accountState.getState().organizations[0].data.slug}/billing`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
render(
|
||||||
|
html`
|
||||||
|
<h1>Select An Organization</h1>
|
||||||
|
<div class="orgGrid">
|
||||||
|
${state.accountState.getState().organizations.map((orgArg) => {
|
||||||
|
return html`
|
||||||
|
<div
|
||||||
|
class="org"
|
||||||
|
@click=${() => {
|
||||||
|
state.accountState.dispatchAction(state.setSelectedOrg, orgArg);
|
||||||
|
const parentElement = (this.getRootNode() as any).host;
|
||||||
|
parentElement.subrouter.pushUrl(`/org/${orgArg.data.slug}/billing`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<dees-icon .iconFA=${"wallet"} style="display: inline-block; transform: translateY(3px); padding-right: 4px;"></dees-icon> ${orgArg.data.name}
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
`,
|
||||||
|
viewHost
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
export * from './baseview.js';
|
||||||
|
export * from './orgsetup.js';
|
||||||
|
export * from './paddlesetup.js';
|
||||||
|
export * from './subscriptions.js';
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
import {
|
||||||
|
customElement,
|
||||||
|
DeesElement,
|
||||||
|
property,
|
||||||
|
html,
|
||||||
|
cssManager,
|
||||||
|
unsafeCSS,
|
||||||
|
css,
|
||||||
|
} from '@design.estate/dees-element';
|
||||||
|
|
||||||
|
import * as plugins from '../../../plugins.js';
|
||||||
|
import sharedStyles from '../sharedstyles.js';
|
||||||
|
import * as state from '../../../states/accountstate.js';
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
'lele-accountview-paddlesetup': PaddleSetupView;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@customElement('lele-accountview-paddlesetup')
|
||||||
|
export class PaddleSetupView extends DeesElement {
|
||||||
|
public static styles = [
|
||||||
|
cssManager.defaultStyles,
|
||||||
|
sharedStyles,
|
||||||
|
css`
|
||||||
|
:host {
|
||||||
|
display: block;
|
||||||
|
max-width: 900px;
|
||||||
|
margin: auto;
|
||||||
|
color: ${cssManager.bdTheme('#333', '#fff')};
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
];
|
||||||
|
|
||||||
|
public render() {
|
||||||
|
return html`
|
||||||
|
<h1>-> Paddle Setup</h1>
|
||||||
|
<p>
|
||||||
|
In order to use workspace.global <b>with paid features</b>, you need to setup a Paddle
|
||||||
|
subscription. A Paddle connection is bound to an organization.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
The base price of a Paddle Subscription is always 0€. Any charges that occur will be billed
|
||||||
|
as an extra charge on top of your free base subscription
|
||||||
|
<b>on a monthly date of your choosing</b>.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Since Paddle acts as merchant of record, your invoices will read Paddle as Creditor, and you
|
||||||
|
as Debitor.
|
||||||
|
</p>
|
||||||
|
<h2>Why are we using Paddle?</h2>
|
||||||
|
<p>
|
||||||
|
Paddle takes care of tax compliance for us. This allows us to sell our products world wide
|
||||||
|
while Paddle makes sure any sales are in compliance with local laws.
|
||||||
|
</p>
|
||||||
|
<dees-button>Let's do it!</dees-button>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public async firstUpdated() {
|
||||||
|
await this.domtoolsPromise;
|
||||||
|
const paddleButton = this.shadowRoot.querySelector('dees-button');
|
||||||
|
const openPaddle = async () => {
|
||||||
|
await this.domtools.setExternalScript('https://cdn.paddle.com/paddle/paddle.js');
|
||||||
|
globalThis.Paddle.Setup({
|
||||||
|
vendor: 30954,
|
||||||
|
eventCallback: async (dataArg) => {
|
||||||
|
// The data.event will specify the event type
|
||||||
|
if (dataArg.event === 'Checkout.Complete') {
|
||||||
|
const data: plugins.idpInterfaces.data.IPaddleCheckoutData = dataArg.eventData;
|
||||||
|
const paddleIframe = document.body.querySelector('iframe');
|
||||||
|
document.body.removeChild(paddleIframe);
|
||||||
|
paddleButton.status = 'pending';
|
||||||
|
paddleButton.text = 'Processing...';
|
||||||
|
await state.accountState.dispatchAction(state.updatePaddleCheckoutId, data.checkout.id);
|
||||||
|
paddleButton.status = 'success';
|
||||||
|
paddleButton.text = 'Paddle connected!'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
globalThis.Paddle.Checkout.open({
|
||||||
|
product: 561076,
|
||||||
|
email: 'phil@kunz.io',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
paddleButton.addEventListener('clicked', async () => {
|
||||||
|
openPaddle();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
import {
|
||||||
|
customElement,
|
||||||
|
DeesElement,
|
||||||
|
property,
|
||||||
|
html,
|
||||||
|
cssManager,
|
||||||
|
unsafeCSS,
|
||||||
|
css,
|
||||||
|
} from '@design.estate/dees-element';
|
||||||
|
|
||||||
|
import sharedStyles from '../sharedstyles.js';
|
||||||
|
|
||||||
|
import * as state from '../../../states/accountstate.js';
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
'lele-accountview-subscription': SubscriptionView;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@customElement('lele-accountview-subscription')
|
||||||
|
export class SubscriptionView extends DeesElement {
|
||||||
|
|
||||||
|
@property({
|
||||||
|
type: Array,
|
||||||
|
})
|
||||||
|
subscriptions: any[] = [{
|
||||||
|
organization: 'org1',
|
||||||
|
'subscription type': 'workspace.global SaaS',
|
||||||
|
price: '4€',
|
||||||
|
userFactor: 4,
|
||||||
|
total: '16.00€'
|
||||||
|
}, {
|
||||||
|
organization: 'org1',
|
||||||
|
'subscription type': 'workspace.global IaaS Base Access',
|
||||||
|
price: '0€',
|
||||||
|
userFactor: 4,
|
||||||
|
total: '0€'
|
||||||
|
}, {
|
||||||
|
organization: 'org1',
|
||||||
|
'subscription type': 'workspace.global SLA Senior',
|
||||||
|
price: '2000€',
|
||||||
|
userFactor: 'none',
|
||||||
|
total: '2000.00€'
|
||||||
|
}];
|
||||||
|
|
||||||
|
public static styles = [
|
||||||
|
cssManager.defaultStyles,
|
||||||
|
sharedStyles,
|
||||||
|
css`
|
||||||
|
:host {
|
||||||
|
display: block;
|
||||||
|
max-width: 900px;
|
||||||
|
margin: auto;
|
||||||
|
color: ${cssManager.bdTheme('#333', '#fff')};
|
||||||
|
}
|
||||||
|
`
|
||||||
|
]
|
||||||
|
|
||||||
|
public render() {
|
||||||
|
return html`
|
||||||
|
<h1>-> Billing & Subscription</h1>
|
||||||
|
This page allows you to setup how you are billed for any workspace.global charges.
|
||||||
|
<h2>PaymentMethod</h2>
|
||||||
|
<p>Our customer-side billing is handled by paddle.com. You subscribe to a free plan there,
|
||||||
|
and we will bill any occurring charges as an extra on the monthly date of your choosing.
|
||||||
|
Paddle.com will take care of proper VAT invoices that will allow for VAT reduction according to the law.</p>
|
||||||
|
<h3>Paddle</h3>
|
||||||
|
<dees-button @click=${async () => {
|
||||||
|
await this.domtoolsPromise;
|
||||||
|
this.domtools.router.pushUrl(`/org/${state.accountState.getState().selectedOrg.data.slug}/paddlesetup`)
|
||||||
|
}}>set up paddle.com</dees-button>
|
||||||
|
<h3>Enterprise billing</h3>
|
||||||
|
Once you have 100 or more Pro Plan users, you can request custom Enterprise billing for your organization here. Note: You are currently not eligible.
|
||||||
|
<h2>Subscriptions</h2>
|
||||||
|
<p>
|
||||||
|
The total price of a subscription already includes all taxes. If you are a VAT registered business,
|
||||||
|
the actual price might be cheaper in case you can claim VAT exemption from the purchase.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Note: Subscriptions are tied to prganizations. You are only seeing subcriptions regarding ${'org1'} right now.
|
||||||
|
To see other organization, select the respective organization at the top left of this page.
|
||||||
|
</p>
|
||||||
|
<dees-table .heading1=${'Subscriptions'} .heading2=${`for organization ${'org1'}`} .data=${this.subscriptions}></dees-table>
|
||||||
|
<dees-button>Add subscription</dees-button>
|
||||||
|
<h2>Accrued IaaS Usage</h2>
|
||||||
|
<p>Note: The accrued IaaS Usage will be charged by adjusting the workspsace.gobal IaaS Postpaid Access price prior the renewal date.</p>
|
||||||
|
<dees-table .heading1=${'Subscriptions'} .heading2=${`for organization ${'org1'}`} .data=${this.subscriptions}></dees-table>
|
||||||
|
<h2>Upcoming Billable Items</h2>
|
||||||
|
<h2>Past Invoices</h2>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,17 +12,17 @@ import {
|
|||||||
} from '@design.estate/dees-element';
|
} from '@design.estate/dees-element';
|
||||||
|
|
||||||
import { commitinfo } from '../../dist_ts/00_commitinfo_data.js';
|
import { commitinfo } from '../../dist_ts/00_commitinfo_data.js';
|
||||||
import { IdpState } from '../idp.state.js';
|
import { IdpState } from '../states/idp.state.js';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface HTMLElementTagNameMap {
|
interface HTMLElementTagNameMap {
|
||||||
'idp-logincontainer': IdpLogincontainer;
|
'idp-centercontainer': IdpCenterContainer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@customElement('idp-logincontainer')
|
@customElement('idp-centercontainer')
|
||||||
export class IdpLogincontainer extends DeesElement {
|
export class IdpCenterContainer extends DeesElement {
|
||||||
public static demo = () => html`<idp-logincontainer></idp-logincontainer>`;
|
public static demo = () => html`<idp-centercontainer></idp-centercontainer>`;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
@@ -48,8 +48,8 @@ export class IdpLogincontainer extends DeesElement {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: all 0.2s;
|
transition: all 0.2s;
|
||||||
transition-delay: 0.2s;
|
transition-delay: 0.05s;
|
||||||
transform: translate3d(0px, 20px, 0px);
|
transform: translate3d(0px, 8px, 0px);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,23 +107,40 @@ export class IdpLogincontainer extends DeesElement {
|
|||||||
<div class="loginblock">
|
<div class="loginblock">
|
||||||
<h1>idp.global</h1>
|
<h1>idp.global</h1>
|
||||||
<div class="contentSpacer">
|
<div class="contentSpacer">
|
||||||
<idp-login></idp-login>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
<div class="legalinfo">
|
<div class="legalinfo">
|
||||||
<a href="https://legal.task.vc/" target="_blank">Legal Info</a>
|
<a href="https://legal.task.vc/" target="_blank">Legal Info</a>
|
||||||
| <a href="https://task.vc/" target="_blank">Company Website</a>
|
| <a href="https://task.vc/" target="_blank">Company Website</a>
|
||||||
| <a href="https://support.task.vc/" target="_blank">Support</a>
|
| <a href="https://support.task.vc/" target="_blank">Support</a>
|
||||||
| SSO v${commitinfo.version}
|
| idp.global v${commitinfo.version}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async firstUpdated() {
|
public async show() {
|
||||||
|
await this.updateComplete;
|
||||||
|
const domtoolsInstance = await this.domtoolsPromise;
|
||||||
|
const done = plugins.smartpromise.defer();
|
||||||
requestAnimationFrame(async () => {
|
requestAnimationFrame(async () => {
|
||||||
this.shadowRoot.querySelector('.mainContainer').classList.add('show');
|
this.shadowRoot.querySelector('.mainContainer').classList.add('show');
|
||||||
this.shadowRoot.querySelector('idp-login').focus();
|
await domtoolsInstance.convenience.smartdelay.delayFor(250);
|
||||||
|
done.resolve();
|
||||||
});
|
});
|
||||||
|
return done.promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async hide() {
|
||||||
|
await this.updateComplete;
|
||||||
|
const domtoolsInstance = await this.domtoolsPromise;
|
||||||
|
const done = plugins.smartpromise.defer();
|
||||||
|
requestAnimationFrame(async () => {
|
||||||
|
this.shadowRoot.querySelector('.mainContainer').classList.remove('show');
|
||||||
|
await domtoolsInstance.convenience.smartdelay.delayFor(250);
|
||||||
|
done.resolve();
|
||||||
|
});
|
||||||
|
return done.promise;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,16 +17,17 @@ import '@uptime.link/webwidget';
|
|||||||
|
|
||||||
import '@design.estate/dees-catalog';
|
import '@design.estate/dees-catalog';
|
||||||
import { DeesForm, DeesFormSubmit, DeesInputText } from '@design.estate/dees-catalog';
|
import { DeesForm, DeesFormSubmit, DeesInputText } from '@design.estate/dees-catalog';
|
||||||
|
import { IdpState } from '../states/idp.state.js';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface HTMLElementTagNameMap {
|
interface HTMLElementTagNameMap {
|
||||||
'idp-login': IdpLogin;
|
'idp-loginprompt': IdpLoginPrompt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@customElement('idp-login')
|
@customElement('idp-loginprompt')
|
||||||
export class IdpLogin extends DeesElement {
|
export class IdpLoginPrompt extends DeesElement {
|
||||||
public static demo = () => html`<idp-login></idp-login>`;
|
public static demo = () => html`<idp-loginprompt></idp-loginprompt>`;
|
||||||
|
|
||||||
@property()
|
@property()
|
||||||
public productOfInterest: string;
|
public productOfInterest: string;
|
||||||
@@ -68,6 +69,7 @@ export class IdpLogin extends DeesElement {
|
|||||||
|
|
||||||
public render(): TemplateResult {
|
public render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
|
<idp-centercontainer>
|
||||||
<div class="boxcontent">
|
<div class="boxcontent">
|
||||||
<dees-form
|
<dees-form
|
||||||
id="loginForm"
|
id="loginForm"
|
||||||
@@ -92,8 +94,12 @@ export class IdpLogin extends DeesElement {
|
|||||||
></dees-input-text>
|
></dees-input-text>
|
||||||
<dees-form-submit id="loginSubmitButton"></dees-form-submit>
|
<dees-form-submit id="loginSubmitButton"></dees-form-submit>
|
||||||
</dees-form>
|
</dees-form>
|
||||||
<dees-button type="discreet" class="registerButton">Register instead</dees-button>
|
<dees-button type="discreet" class="registerButton" @clicked=${async () => {
|
||||||
|
const idpState = await IdpState.getSingletonInstance();
|
||||||
|
idpState.domtools.router.pushUrl('/register');
|
||||||
|
}}>Register instead</dees-button>
|
||||||
</div>
|
</div>
|
||||||
|
</idp-centercontainer>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,7 +124,11 @@ export class IdpLogin extends DeesElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private login = async (valueArg: { emailAddress: string; passwordArg: string }) => {
|
private login = async (valueArg: { emailAddress: string; passwordArg: string }) => {
|
||||||
|
// lets disable the register button
|
||||||
|
const registerButton: plugins.deesCatalog.DeesButton = this.shadowRoot.querySelector('.registerButton');
|
||||||
|
registerButton.disabled = true;
|
||||||
// lets define the needed requests
|
// lets define the needed requests
|
||||||
|
const idpState = await IdpState.getSingletonInstance();
|
||||||
const loginForm: DeesForm = this.shadowRoot.querySelector('#loginForm');
|
const loginForm: DeesForm = this.shadowRoot.querySelector('#loginForm');
|
||||||
const loginRequestWithUsernameAndPassword =
|
const loginRequestWithUsernameAndPassword =
|
||||||
new domtools.TypedRequest<plugins.idpInterfaces.request.IReq_LoginWithEmailOrUsernameAndPassword>(
|
new domtools.TypedRequest<plugins.idpInterfaces.request.IReq_LoginWithEmailOrUsernameAndPassword>(
|
||||||
@@ -148,9 +158,10 @@ export class IdpLogin extends DeesElement {
|
|||||||
}
|
}
|
||||||
if (response.refreshToken) {
|
if (response.refreshToken) {
|
||||||
loginForm.setStatus('pending', 'obtained refreshToken...');
|
loginForm.setStatus('pending', 'obtained refreshToken...');
|
||||||
const jwt = await this.handleRefreshToken(response.refreshToken, 0);
|
const jwt = await idpState.idpClient.refreshJwt(response.refreshToken);
|
||||||
if (jwt) {
|
if (jwt) {
|
||||||
loginForm.setStatus('success', 'obtained jwt.');
|
loginForm.setStatus('success', 'obtained jwt.');
|
||||||
|
idpState.domtools.router.pushUrl('/account');
|
||||||
} else {
|
} else {
|
||||||
loginForm.setStatus('error', 'something went wrong');
|
loginForm.setStatus('error', 'something went wrong');
|
||||||
}
|
}
|
||||||
@@ -184,28 +195,21 @@ export class IdpLogin extends DeesElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async handleRefreshToken(refreshTokenArg: string, delayDispatchMillisArg = 0) {
|
|
||||||
// a refreshToken binds dierctly to a session.
|
|
||||||
// the refresh token is used on a continuous basis to get fresh and short-lived jwts
|
|
||||||
const refreshJwt = new domtools.TypedRequest<plugins.idpInterfaces.request.IReq_RefreshJwt>(
|
|
||||||
'/typedrequest',
|
|
||||||
'refreshJwt'
|
|
||||||
);
|
|
||||||
const responseJwt = await refreshJwt.fire({
|
|
||||||
refreshToken: refreshTokenArg,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (responseJwt.jwt) {
|
|
||||||
this.domtools.convenience.smartdelay.delayFor(delayDispatchMillisArg).then(() => {
|
|
||||||
this.dispatchJwt(responseJwt.jwt);
|
|
||||||
});
|
|
||||||
return responseJwt.jwt;
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public async focus() {
|
public async focus() {
|
||||||
(this.shadowRoot.querySelector('#loginEmailInput') as plugins.deesCatalog.DeesInputText).focus();
|
(
|
||||||
|
this.shadowRoot.querySelector('#loginEmailInput') as plugins.deesCatalog.DeesInputText
|
||||||
|
).focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async show() {
|
||||||
|
await this.updateComplete;
|
||||||
|
const centerContainer = this.shadowRoot.querySelector('idp-centercontainer');
|
||||||
|
await centerContainer.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async hide() {
|
||||||
|
await this.updateComplete;
|
||||||
|
const centerContainer = this.shadowRoot.querySelector('idp-centercontainer');
|
||||||
|
await centerContainer.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import '@uptime.link/webwidget';
|
|||||||
|
|
||||||
import '@design.estate/dees-catalog';
|
import '@design.estate/dees-catalog';
|
||||||
import { DeesForm, DeesFormSubmit, DeesInputText } from '@design.estate/dees-catalog';
|
import { DeesForm, DeesFormSubmit, DeesInputText } from '@design.estate/dees-catalog';
|
||||||
|
import { IdpState } from '../states/idp.state.js';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface HTMLElementTagNameMap {
|
interface HTMLElementTagNameMap {
|
||||||
@@ -56,14 +57,6 @@ export class IdpRegistrationPrompt extends DeesElement {
|
|||||||
color: ${cssManager.bdTheme('#333333', '#ffffff')};
|
color: ${cssManager.bdTheme('#333333', '#ffffff')};
|
||||||
}
|
}
|
||||||
|
|
||||||
.box {
|
|
||||||
opacity: 0;
|
|
||||||
cursor: pointer;
|
|
||||||
overflow: hidden;
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
height: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.boxcontent {
|
.boxcontent {
|
||||||
margin: 0px 20px;
|
margin: 0px 20px;
|
||||||
}
|
}
|
||||||
@@ -79,11 +72,16 @@ export class IdpRegistrationPrompt extends DeesElement {
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
transform: scale(1.02);
|
transform: scale(1.02);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.loginButton {
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
|
|
||||||
public render(): TemplateResult {
|
public render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
|
<idp-centercontainer>
|
||||||
<div class="boxcontent">
|
<div class="boxcontent">
|
||||||
<dees-form
|
<dees-form
|
||||||
id="registrationForm"
|
id="registrationForm"
|
||||||
@@ -103,12 +101,22 @@ export class IdpRegistrationPrompt extends DeesElement {
|
|||||||
></dees-input-checkbox>
|
></dees-input-checkbox>
|
||||||
<dees-form-submit>Send Verification Email</dees-form-submit>
|
<dees-form-submit>Send Verification Email</dees-form-submit>
|
||||||
</dees-form>
|
</dees-form>
|
||||||
|
<dees-button type="discreet" class="loginButton" @click=${async () => {
|
||||||
|
const idpState = await IdpState.getSingletonInstance();
|
||||||
|
idpState.domtools.router.pushUrl('/login');
|
||||||
|
}}>Login instead</dees-button>
|
||||||
</div>
|
</div>
|
||||||
|
</idp-centercontainer>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async firstUpdated() {
|
public async firstUpdated() {
|
||||||
const domtoolsInstance = await this.domtoolsPromise;
|
await this.domtoolsPromise;
|
||||||
|
const idpState = await IdpState.getSingletonInstance();
|
||||||
|
const loggedIn = await idpState.idpClient.determineLoginStatus();
|
||||||
|
if (loggedIn) {
|
||||||
|
idpState.domtools.router.pushUrl('/');
|
||||||
|
}
|
||||||
const loginForm: DeesForm = this.shadowRoot.querySelector('#loginForm');
|
const loginForm: DeesForm = this.shadowRoot.querySelector('#loginForm');
|
||||||
const loginPasswordInput: DeesInputText = loginForm.querySelector('#loginPasswordInput');
|
const loginPasswordInput: DeesInputText = loginForm.querySelector('#loginPasswordInput');
|
||||||
const loginSubmitButton: DeesFormSubmit = loginForm.querySelector('#loginSubmitButton');
|
const loginSubmitButton: DeesFormSubmit = loginForm.querySelector('#loginSubmitButton');
|
||||||
@@ -186,4 +194,16 @@ export class IdpRegistrationPrompt extends DeesElement {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async show() {
|
||||||
|
await this.updateComplete;
|
||||||
|
const centerContainer = this.shadowRoot.querySelector('idp-centercontainer');
|
||||||
|
await centerContainer.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async hide() {
|
||||||
|
await this.updateComplete;
|
||||||
|
const centerContainer = this.shadowRoot.querySelector('idp-centercontainer');
|
||||||
|
await centerContainer.hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { IdpState } from '../idp.state.js';
|
import { IdpState } from '../states/idp.state.js';
|
||||||
import * as plugins from '../plugins.js';
|
import * as plugins from '../plugins.js';
|
||||||
import {
|
import {
|
||||||
customElement,
|
customElement,
|
||||||
@@ -14,7 +14,6 @@ import {
|
|||||||
|
|
||||||
@customElement('idp-registration-stepper')
|
@customElement('idp-registration-stepper')
|
||||||
export class IdpRegistrationStepper extends DeesElement {
|
export class IdpRegistrationStepper extends DeesElement {
|
||||||
|
|
||||||
@state()
|
@state()
|
||||||
private usedSubTemplate: TemplateResult;
|
private usedSubTemplate: TemplateResult;
|
||||||
|
|
||||||
@@ -67,43 +66,42 @@ export class IdpRegistrationStepper extends DeesElement {
|
|||||||
public async firstUpdated() {
|
public async firstUpdated() {
|
||||||
const idpState = await IdpState.getSingletonInstance();
|
const idpState = await IdpState.getSingletonInstance();
|
||||||
await this.domtoolsPromise;
|
await this.domtoolsPromise;
|
||||||
this.domtools.router.on(`/finishregistration`, async (routeArg) => {
|
const parsedUrl = plugins.smarturl.Smarturl.createFromUrl(window.location.href);
|
||||||
this.storedData.validationTokenUrlParam = routeArg.queryParams.validationtoken;
|
this.storedData.validationTokenUrlParam = parsedUrl.searchParams['validationtoken'];
|
||||||
|
console.log(`validationToken is ${this.storedData.validationTokenUrlParam}`);
|
||||||
if (!this.storedData.validationTokenUrlParam) {
|
if (!this.storedData.validationTokenUrlParam) {
|
||||||
this.usedSubTemplate = html`
|
this.usedSubTemplate = html`
|
||||||
You need a validation token, but we couldn't find one. Please contact workspace.global support.
|
You need a validation token, but we couldn't find one. Please contact workspace.global
|
||||||
|
support.
|
||||||
`;
|
`;
|
||||||
await this.domtools.convenience.smartdelay.delayFor(5000);
|
await this.domtools.convenience.smartdelay.delayFor(5000);
|
||||||
this.usedSubTemplate = html` Redirecting you to workspace.global support... `;
|
window.location.href = '/';
|
||||||
await this.domtools.convenience.smartdelay.delayFor(2000);
|
|
||||||
window.location.href = 'https://support.workspace.global';
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// lets verify the info;
|
// lets verify the info;
|
||||||
let tokenErrorMessage: string;
|
let tokenErrorMessage: string;
|
||||||
const resAfterRegEmailClicked =
|
const resAfterRegEmailClicked = await idpState.idpClient.requests.afterRegistrationEmailClicked
|
||||||
await idpState.idpClient.requests.afterRegistrationEmailClicked
|
|
||||||
.fire({
|
.fire({
|
||||||
token: this.storedData.validationTokenUrlParam,
|
token: this.storedData.validationTokenUrlParam,
|
||||||
})
|
})
|
||||||
.catch(
|
.catch(
|
||||||
(
|
(
|
||||||
err: typeof DeesElement['prototype']['domtools']['convenience']['typedrequest']['TypedResponseError']['prototype']
|
err: (typeof DeesElement)['prototype']['domtools']['convenience']['typedrequest']['TypedResponseError']['prototype']
|
||||||
) => {
|
) => {
|
||||||
tokenErrorMessage = err.errorText;
|
tokenErrorMessage = err.errorText;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log(resAfterRegEmailClicked);
|
||||||
|
|
||||||
if (!resAfterRegEmailClicked || !resAfterRegEmailClicked.email) {
|
if (!resAfterRegEmailClicked || !resAfterRegEmailClicked.email) {
|
||||||
this.usedSubTemplate = html`
|
this.usedSubTemplate = html`
|
||||||
the supplied validation token does not match any registration sessions.<br />
|
the supplied validation token does not match any registration sessions.<br />
|
||||||
${tokenErrorMessage ? html`Reason: ${tokenErrorMessage}` : null}
|
${tokenErrorMessage ? html`Reason: ${tokenErrorMessage}` : null}
|
||||||
`;
|
`;
|
||||||
await this.domtools.convenience.smartdelay.delayFor(5000);
|
await this.domtools.convenience.smartdelay.delayFor(5000);
|
||||||
this.usedSubTemplate = html`redirecting you for further support... `;
|
idpState.domtools.router.pushUrl('/');
|
||||||
await this.domtools.convenience.smartdelay.delayFor(1000);
|
|
||||||
window.location.href = 'https://support.workspace.global';
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
this.storedData.email = resAfterRegEmailClicked.email;
|
this.storedData.email = resAfterRegEmailClicked.email;
|
||||||
@@ -143,7 +141,7 @@ export class IdpRegistrationStepper extends DeesElement {
|
|||||||
})
|
})
|
||||||
.catch(
|
.catch(
|
||||||
(
|
(
|
||||||
errArg: typeof DeesElement['prototype']['domtools']['convenience']['typedrequest']['TypedResponseError']['prototype']
|
errArg: (typeof DeesElement)['prototype']['domtools']['convenience']['typedrequest']['TypedResponseError']['prototype']
|
||||||
) => {
|
) => {
|
||||||
deesForm.setStatus('error', errArg.errorText);
|
deesForm.setStatus('error', errArg.errorText);
|
||||||
}
|
}
|
||||||
@@ -179,7 +177,7 @@ export class IdpRegistrationStepper extends DeesElement {
|
|||||||
})
|
})
|
||||||
.catch(
|
.catch(
|
||||||
(
|
(
|
||||||
errArg: typeof DeesElement['prototype']['domtools']['convenience']['typedrequest']['TypedResponseError']['prototype']
|
errArg: (typeof DeesElement)['prototype']['domtools']['convenience']['typedrequest']['TypedResponseError']['prototype']
|
||||||
) => {
|
) => {
|
||||||
deesForm.setStatus('error', errArg.errorText);
|
deesForm.setStatus('error', errArg.errorText);
|
||||||
}
|
}
|
||||||
@@ -262,12 +260,11 @@ export class IdpRegistrationStepper extends DeesElement {
|
|||||||
deesForm.setStatus('pending', 'User created!');
|
deesForm.setStatus('pending', 'User created!');
|
||||||
await this.domtools.convenience.smartdelay.delayFor(500);
|
await this.domtools.convenience.smartdelay.delayFor(500);
|
||||||
deesForm.setStatus('pending', 'Obtaining Refresh Token...');
|
deesForm.setStatus('pending', 'Obtaining Refresh Token...');
|
||||||
const loginResponse = await idpState.idpClient.requests.loginWithUserNameAndPassword.fire(
|
const loginResponse =
|
||||||
{
|
await idpState.idpClient.requests.loginWithUserNameAndPassword.fire({
|
||||||
username: this.storedData.email,
|
username: this.storedData.email,
|
||||||
password: eventArg.detail.data.password,
|
password: eventArg.detail.data.password,
|
||||||
}
|
});
|
||||||
);
|
|
||||||
this.storedData.refreshToken = loginResponse.refreshToken;
|
this.storedData.refreshToken = loginResponse.refreshToken;
|
||||||
|
|
||||||
deesForm.setStatus('pending', 'Obtaining JWT...');
|
deesForm.setStatus('pending', 'Obtaining JWT...');
|
||||||
@@ -275,22 +272,14 @@ export class IdpRegistrationStepper extends DeesElement {
|
|||||||
refreshToken: this.storedData.refreshToken,
|
refreshToken: this.storedData.refreshToken,
|
||||||
});
|
});
|
||||||
|
|
||||||
deesForm.setStatus('pending', 'Obtaining Transfer Token...');
|
deesForm.setStatus('success', 'Ok! Lets Go!');
|
||||||
await idpState.idpClient.setJwt(jwtResponse.jwt);
|
await idpState.idpClient.setJwt(jwtResponse.jwt);
|
||||||
await idpState.idpClient.getTransferTokenAndSwitchToLocation('https://sso.workspace.global/afterregistration');
|
idpState.domtools.router.pushUrl('/account');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
] as plugins.deesCatalog.IStep[]}
|
] as plugins.deesCatalog.IStep[]}
|
||||||
></dees-stepper>`;
|
></dees-stepper>`;
|
||||||
await this.domtools.convenience.smartdelay.delayFor(100);
|
await this.domtools.convenience.smartdelay.delayFor(100);
|
||||||
});
|
|
||||||
this.domtools.router.on('/', async () => {
|
|
||||||
this.usedSubTemplate = html`Hm, this is app is not meant for what you are trying to do :) `;
|
|
||||||
await this.domtools.convenience.smartdelay.delayFor(2000);
|
|
||||||
this.usedSubTemplate = html`Redirecting you now...`;
|
|
||||||
window.location.href = `https://workspace.global`;
|
|
||||||
});
|
|
||||||
this.domtools.router._handleRouteState();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,11 @@ import {
|
|||||||
cssManager,
|
cssManager,
|
||||||
unsafeCSS,
|
unsafeCSS,
|
||||||
css,
|
css,
|
||||||
|
resolveExec,
|
||||||
type TemplateResult,
|
type TemplateResult,
|
||||||
} from '@design.estate/dees-element';
|
} from '@design.estate/dees-element';
|
||||||
import type { IdpViewcontainer } from '../views/viewcontainer.js';
|
import type { IdpViewcontainer } from '../views/viewcontainer.js';
|
||||||
import { IdpState } from '../idp.state.js';
|
import { IdpState } from '../states/idp.state.js';
|
||||||
|
|
||||||
@customElement('idp-welcome')
|
@customElement('idp-welcome')
|
||||||
export class IdpWelcome extends DeesElement {
|
export class IdpWelcome extends DeesElement {
|
||||||
@@ -34,27 +35,20 @@ export class IdpWelcome extends DeesElement {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
.maincontainer {
|
||||||
font-family: 'Cal Sans';
|
padding: 0px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.greeting {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 24px;
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
margin: 24px auto;
|
margin: 24px auto;
|
||||||
padding: 0px 24px;
|
|
||||||
width: 500px;
|
|
||||||
letter-spacing:0.0125em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.textbox {
|
dees-button {
|
||||||
margin: 24px auto;
|
|
||||||
width: 500px;
|
|
||||||
background: #111111;
|
|
||||||
border-radius: 16px;
|
|
||||||
border-top: 1px solid ${cssManager.bdTheme('#ffffff', '#222222')};
|
|
||||||
padding: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.textbox dees-button {
|
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
@@ -62,28 +56,71 @@ export class IdpWelcome extends DeesElement {
|
|||||||
public render(): TemplateResult {
|
public render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
<style></style>
|
<style></style>
|
||||||
<h1>idp.global</h1>
|
<idp-centercontainer>
|
||||||
|
<div class="maincontainer">
|
||||||
<div class="textbox">
|
${resolveExec(async () => {
|
||||||
Do you want to sign in or register?
|
|
||||||
<dees-button @click=${async () => {
|
|
||||||
const idpState = await IdpState.getSingletonInstance();
|
const idpState = await IdpState.getSingletonInstance();
|
||||||
idpState.domtools.router.pushUrl('/login');
|
await idpState.idpClient.determineLoginStatus();
|
||||||
}}>Sign In</dees-button>
|
const data = await idpState.idpClient.whoIs().catch();
|
||||||
<dees-button @click=${() => {}}>Register</dees-button>
|
if (data?.user) {
|
||||||
</div>
|
return html`
|
||||||
|
<div class="greeting">Hello ${data.user.data.name}!</div>
|
||||||
<div class="textbox">
|
<dees-button
|
||||||
Do you want to use idp.global for your app?
|
@click=${async () => {
|
||||||
<dees-button @click=${() => {}}>Open Developer Dashboard</dees-button>
|
const idpState = await IdpState.getSingletonInstance();
|
||||||
</div>
|
idpState.domtools.router.pushUrl('/account');
|
||||||
|
}}
|
||||||
<div class="textbox">
|
>Manage your account</dees-button
|
||||||
idp.global is a Open Source identity provider for the world wide web. You can get the code if you want to improve it.
|
>
|
||||||
<dees-button @click=${() => {
|
<dees-button
|
||||||
window.open('https://code.foss.global/idp.global/idp.global', '_blank');
|
@click=${async () => {
|
||||||
}}>Get the code</dees-button>
|
const idpState = await IdpState.getSingletonInstance();
|
||||||
</div>
|
idpState.domtools.router.pushUrl('/logout');
|
||||||
|
}}
|
||||||
|
>Logout</dees-button
|
||||||
|
>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
return html`
|
||||||
|
Do you want to sign in or register?
|
||||||
|
<dees-button
|
||||||
|
@click=${async () => {
|
||||||
|
const idpState = await IdpState.getSingletonInstance();
|
||||||
|
idpState.domtools.router.pushUrl('/login');
|
||||||
|
}}
|
||||||
|
>Sign In</dees-button
|
||||||
|
>
|
||||||
|
<dees-button
|
||||||
|
@click=${async () => {
|
||||||
|
const idpState = await IdpState.getSingletonInstance();
|
||||||
|
idpState.domtools.router.pushUrl('/register');
|
||||||
|
}}
|
||||||
|
>Register</dees-button
|
||||||
|
>
|
||||||
|
`;
|
||||||
|
})}
|
||||||
|
<dees-button @click=${() => {}}>Learn more about idp.global</dees-button>
|
||||||
|
<dees-button @click=${() => {}}>Open Developer Dashboard</dees-button>
|
||||||
|
<dees-button
|
||||||
|
@click=${() => {
|
||||||
|
window.open('https://code.foss.global/idp.global/idp.global', '_blank');
|
||||||
|
}}
|
||||||
|
>Get the Source Code</dees-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</idp-centercontainer>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async show() {
|
||||||
|
await this.updateComplete;
|
||||||
|
const centerContainer = this.shadowRoot.querySelector('idp-centercontainer');
|
||||||
|
await centerContainer.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async hide() {
|
||||||
|
await this.updateComplete;
|
||||||
|
const centerContainer = this.shadowRoot.querySelector('idp-centercontainer');
|
||||||
|
await centerContainer.hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
export * from './idp-registration-stepper.js';
|
export * from './idp-registration-stepper.js';
|
||||||
export * from './idp-logincontainer.js';
|
export * from './idp-centercontainer.js';
|
||||||
export * from './idp-loginprompt.js';
|
export * from './idp-loginprompt.js';
|
||||||
export * from './idp-registerprompt.js';
|
export * from './idp-registerprompt.js';
|
||||||
export * from './idp-transfermanager.js';
|
export * from './idp-transfermanager.js';
|
||||||
export * from './idp-welcome.js';
|
export * from './idp-welcome.js';
|
||||||
|
|
||||||
|
import { IdpAccountContent } from './account/index.js';
|
||||||
|
|
||||||
|
export { IdpAccountContent };
|
||||||
|
|||||||
+1
-1
@@ -44,7 +44,7 @@ const run = async () => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const serviceWorker = await serviceworker.getServiceworkerClient();
|
// const serviceWorker = await serviceworker.getServiceworkerClient();
|
||||||
|
|
||||||
const mainTemplate = html`
|
const mainTemplate = html`
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -23,3 +23,8 @@ import * as smartpromise from '@push.rocks/smartpromise';
|
|||||||
import * as smarturl from '@push.rocks/smarturl';
|
import * as smarturl from '@push.rocks/smarturl';
|
||||||
|
|
||||||
export { smartpromise, smarturl };
|
export { smartpromise, smarturl };
|
||||||
|
|
||||||
|
// @tsclass scope
|
||||||
|
import * as tsclass from '@tsclass/tsclass';
|
||||||
|
|
||||||
|
export { tsclass };
|
||||||
|
|||||||
@@ -0,0 +1,101 @@
|
|||||||
|
import * as plugins from '../plugins.js';
|
||||||
|
import { IdpState } from './idp.state.js';
|
||||||
|
|
||||||
|
export type TStateTypes = 'IAccountState';
|
||||||
|
export interface IAccountState {
|
||||||
|
user: plugins.idpInterfaces.data.IUser;
|
||||||
|
/**
|
||||||
|
* the available orgs
|
||||||
|
*/
|
||||||
|
organizations: Array<plugins.idpInterfaces.data.IOrganization>;
|
||||||
|
roles: Array<plugins.idpInterfaces.data.IRole>
|
||||||
|
|
||||||
|
selectedOrg: plugins.idpInterfaces.data.IOrganization;
|
||||||
|
selectedOrgBillingPlan: plugins.tsclass.typeFest.PartialDeep<plugins.idpInterfaces.data.IBillingPlan>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* used for keeping the state when creating a new org
|
||||||
|
*/
|
||||||
|
newOrg: {
|
||||||
|
chosenName: string;
|
||||||
|
chosenSlug: string;
|
||||||
|
validated: boolean;
|
||||||
|
validationOk: boolean;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const smartStateInstance = new plugins.deesDomtools.plugins.smartstate.Smartstate<TStateTypes>();
|
||||||
|
export const accountState = await smartStateInstance.getStatePart<IAccountState>('IAccountState', {
|
||||||
|
user: null,
|
||||||
|
organizations: [],
|
||||||
|
roles: [],
|
||||||
|
selectedOrg: null,
|
||||||
|
selectedOrgBillingPlan: null,
|
||||||
|
newOrg: {
|
||||||
|
chosenName: null,
|
||||||
|
chosenSlug: null,
|
||||||
|
validated: null,
|
||||||
|
validationOk: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export const getOrganizationsAction = accountState.createAction<void>(
|
||||||
|
async (statePartArg, payloadArg) => {
|
||||||
|
const idpState = await IdpState.getSingletonInstance();
|
||||||
|
const currentState = statePartArg.getState();
|
||||||
|
const response = await idpState.idpClient.getRolesAndOrganizations();
|
||||||
|
currentState.organizations = response.organizations;
|
||||||
|
currentState.roles = response.roles;
|
||||||
|
return currentState;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
export const setNewOrgName = accountState.createAction<string>(async (statePartArg, payloadArg) => {
|
||||||
|
const idpState = await IdpState.getSingletonInstance();
|
||||||
|
const currentState = statePartArg.getState();
|
||||||
|
currentState.newOrg.chosenName = payloadArg;
|
||||||
|
currentState.newOrg.chosenSlug = payloadArg
|
||||||
|
.replace(/[^a-zA-Z0-9]/g, '-')
|
||||||
|
.replace(/\s/g, '-')
|
||||||
|
.toLowerCase();
|
||||||
|
const result = await idpState.idpClient.createOrganization(
|
||||||
|
currentState.newOrg.chosenName,
|
||||||
|
currentState.newOrg.chosenSlug,
|
||||||
|
'checkAvailability'
|
||||||
|
);
|
||||||
|
console.log(result);
|
||||||
|
currentState.newOrg.validated = true;
|
||||||
|
currentState.newOrg.validationOk = result.nameAvailable;
|
||||||
|
if (payloadArg === '') {
|
||||||
|
currentState.newOrg.validated = false;
|
||||||
|
currentState.newOrg.validationOk = false;
|
||||||
|
}
|
||||||
|
return currentState;
|
||||||
|
});
|
||||||
|
|
||||||
|
export const manifestNewOrgName = accountState.createAction(async (statePartArg, payloadArg) => {
|
||||||
|
const idpState = await IdpState.getSingletonInstance();
|
||||||
|
const currentState: IAccountState = statePartArg.getState();
|
||||||
|
const result = await idpState.idpClient.createOrganization(
|
||||||
|
currentState.newOrg.chosenName,
|
||||||
|
currentState.newOrg.chosenSlug,
|
||||||
|
'manifest'
|
||||||
|
);
|
||||||
|
currentState.organizations.push(result.resultingOrganization);
|
||||||
|
currentState.selectedOrg = result.resultingOrganization;
|
||||||
|
return currentState;
|
||||||
|
});
|
||||||
|
|
||||||
|
export const setSelectedOrg = accountState.createAction<plugins.idpInterfaces.data.IOrganization>(async (statePartArg, payloadArg) => {
|
||||||
|
const currentState = statePartArg.getState();
|
||||||
|
currentState.selectedOrg = payloadArg;
|
||||||
|
return currentState;
|
||||||
|
})
|
||||||
|
|
||||||
|
export const updatePaddleCheckoutId = accountState.createAction<string>(async (statePartArg, checkoutIdArg) => {
|
||||||
|
const idpState = await IdpState.getSingletonInstance();
|
||||||
|
const currentState: IAccountState = statePartArg.getState();
|
||||||
|
const response = await idpState.idpClient.updatePaddleCheckoutId(currentState.selectedOrg.id, checkoutIdArg);
|
||||||
|
currentState.selectedOrgBillingPlan = response.billingPlan;
|
||||||
|
return currentState;
|
||||||
|
});
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import * as plugins from './plugins.js';
|
import * as plugins from '../plugins.js';
|
||||||
import { domtools } from '@design.estate/dees-element'
|
import { domtools } from '@design.estate/dees-element'
|
||||||
|
|
||||||
export class IdpState {
|
export class IdpState {
|
||||||
@@ -15,14 +15,15 @@ export class IdpState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// INSTANCE
|
// INSTANCE
|
||||||
public receptionUrl = 'https://reception.lossless.one/typedrequest';
|
public receptionUrl = window.location.origin;
|
||||||
public idpClient = new plugins.idpClient.IdpClient(this.receptionUrl);
|
public idpClient = new plugins.idpClient.IdpClient(this.receptionUrl);
|
||||||
public domtools: domtools.DomTools;
|
public domtools: domtools.DomTools;
|
||||||
public mainStatePart: plugins.deesDomtools.plugins.smartstate.StatePart<'main', {
|
public mainStatePart: plugins.deesDomtools.plugins.smartstate.StatePart<'main', {
|
||||||
view: 'welcome' | 'login' | 'register';
|
view: 'welcome' | 'login' | 'register' | 'finishregistration' | 'account' | 'logout';
|
||||||
}>
|
}>
|
||||||
|
|
||||||
public async init() {
|
public async init() {
|
||||||
|
this.idpClient.enableTypedSocket();
|
||||||
const domtoolsInstance = await domtools.DomTools.setupDomTools();
|
const domtoolsInstance = await domtools.DomTools.setupDomTools();
|
||||||
this.domtools = domtoolsInstance;
|
this.domtools = domtoolsInstance;
|
||||||
const state = new plugins.deesDomtools.plugins.smartstate.Smartstate<'main'>();
|
const state = new plugins.deesDomtools.plugins.smartstate.Smartstate<'main'>();
|
||||||
@@ -43,12 +44,35 @@ export class IdpState {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.domtools.router.on('/logout', async () => {
|
||||||
|
await this.idpClient.logout();
|
||||||
|
await this.mainStatePart.setState({
|
||||||
|
...this.mainStatePart.getState(),
|
||||||
|
view: 'logout',
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
this.domtools.router.on('/register', async () => {
|
this.domtools.router.on('/register', async () => {
|
||||||
await this.mainStatePart.setState({
|
await this.mainStatePart.setState({
|
||||||
...this.mainStatePart.getState(),
|
...this.mainStatePart.getState(),
|
||||||
view: 'register',
|
view: 'register',
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.domtools.router.on('/finishregistration', async () => {
|
||||||
|
await this.mainStatePart.setState({
|
||||||
|
...this.mainStatePart.getState(),
|
||||||
|
view: 'finishregistration',
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
this.domtools.router.on('/account{/*path}', async () => {
|
||||||
|
await this.mainStatePart.setState({
|
||||||
|
...this.mainStatePart.getState(),
|
||||||
|
view: 'account',
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
this.domtools.router._handleRouteState();
|
this.domtools.router._handleRouteState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { IdpState } from '../idp.state.js';
|
import { IdpState } from '../states/idp.state.js';
|
||||||
import * as plugins from '../plugins.js';
|
import * as plugins from '../plugins.js';
|
||||||
import * as elements from '../elements/index.js';
|
import * as elements from '../elements/index.js';
|
||||||
|
|
||||||
@@ -33,6 +33,7 @@ export class IdpViewcontainer extends DeesElement {
|
|||||||
.viewContainer {
|
.viewContainer {
|
||||||
min-width: 100vh;
|
min-width: 100vh;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
|
background: linear-gradient(-255deg,#06152280 -3.35%,#939eff38 32.79%,#22578480 67.41%,#06152280 97.48%),#212121;
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
@@ -59,16 +60,34 @@ export class IdpViewcontainer extends DeesElement {
|
|||||||
throw new Error('View container not found in the rendered DOM.');
|
throw new Error('View container not found in the rendered DOM.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.currentElement) {
|
||||||
|
this.currentElement = viewContainer.children[0] as any;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if current element already is instance of viewElement
|
||||||
|
if (this.currentElement instanceof viewElement) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Remove the current element if it exists
|
// Remove the current element if it exists
|
||||||
if (this.currentElement) {
|
if (this.currentElement) {
|
||||||
|
const currentElement = this.currentElement as any;
|
||||||
|
if (currentElement.hide) {
|
||||||
|
await currentElement.hide();
|
||||||
|
}
|
||||||
viewContainer.removeChild(this.currentElement);
|
viewContainer.removeChild(this.currentElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a new instance of the viewElement
|
// Create a new instance of the viewElement
|
||||||
const newElement = new viewElement();
|
const newElement = new viewElement() as any;
|
||||||
(newElement as any).viewContainer = this;
|
(newElement as any).viewContainer = this;
|
||||||
viewContainer.appendChild(newElement);
|
viewContainer.appendChild(newElement);
|
||||||
|
|
||||||
|
if (newElement.show) {
|
||||||
|
await newElement.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Wait until the new element is fully rendered
|
// Wait until the new element is fully rendered
|
||||||
await newElement.updateComplete;
|
await newElement.updateComplete;
|
||||||
|
|
||||||
@@ -87,11 +106,18 @@ export class IdpViewcontainer extends DeesElement {
|
|||||||
break;
|
break;
|
||||||
case 'login':
|
case 'login':
|
||||||
console.log('now on /login');
|
console.log('now on /login');
|
||||||
await this.loadElement(elements.IdpLogincontainer);
|
await this.loadElement(elements.IdpLoginPrompt);
|
||||||
break;
|
break;
|
||||||
case 'register':
|
case 'register':
|
||||||
await this.loadElement(elements.IdpRegistrationPrompt);
|
await this.loadElement(elements.IdpRegistrationPrompt);
|
||||||
break;
|
break;
|
||||||
|
case 'finishregistration':
|
||||||
|
await this.loadElement(elements.IdpRegistrationStepper);
|
||||||
|
break;
|
||||||
|
case 'account':
|
||||||
|
console.log('now on /account');
|
||||||
|
await this.loadElement(elements.IdpAccountContent);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user