All customized logo (#2168)
* Change dynamic logo in reconnecting scene * Add cowebsite customized logo * Fix prettier issues * Fix prettier issues (2) * Fix login scene PoweredBy * Delete all console logs
This commit is contained in:
@@ -418,7 +418,7 @@ export class AuthenticateController extends BaseHttpController {
|
||||
profileCallback() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
||||
this.app.get("/profile-callback", async (req, res) => {
|
||||
const { token } = parse(req.path_query);
|
||||
const { token, playUri } = parse(req.path_query);
|
||||
try {
|
||||
//verify connected by token
|
||||
if (token != undefined) {
|
||||
@@ -431,7 +431,10 @@ export class AuthenticateController extends BaseHttpController {
|
||||
|
||||
//get login profile
|
||||
res.status(302);
|
||||
res.setHeader("Location", adminService.getProfileUrl(authTokenData.accessToken));
|
||||
res.setHeader(
|
||||
"Location",
|
||||
adminService.getProfileUrl(authTokenData.accessToken, playUri as string)
|
||||
);
|
||||
res.send("");
|
||||
return;
|
||||
} catch (error) {
|
||||
@@ -497,7 +500,7 @@ export class AuthenticateController extends BaseHttpController {
|
||||
* @param email
|
||||
* @param playUri
|
||||
* @param IPAddress
|
||||
* @return
|
||||
* @return
|
||||
|object
|
||||
* @private
|
||||
*/
|
||||
|
||||
@@ -457,11 +457,15 @@ class AdminApi implements AdminInterface {
|
||||
});
|
||||
}
|
||||
|
||||
getProfileUrl(accessToken: string): string {
|
||||
getProfileUrl(accessToken: string, playUri: string): string {
|
||||
if (!OPID_PROFILE_SCREEN_PROVIDER) {
|
||||
throw new Error("No admin backoffice set!");
|
||||
}
|
||||
return `${OPID_PROFILE_SCREEN_PROVIDER}?accessToken=${accessToken}`;
|
||||
return `${OPID_PROFILE_SCREEN_PROVIDER}?accessToken=${accessToken}&playUri=${playUri}`;
|
||||
}
|
||||
|
||||
async logoutOauth(token: string): Promise<void> {
|
||||
await Axios.get(ADMIN_API_URL + `/oauth/logout?token=${token}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,13 @@ export interface AdminInterface {
|
||||
|
||||
/**
|
||||
* @param accessToken
|
||||
* @param playUri
|
||||
* @return string
|
||||
*/
|
||||
getProfileUrl(accessToken: string): string;
|
||||
getProfileUrl(accessToken: string, playUri: string): string;
|
||||
|
||||
/**
|
||||
* @param token
|
||||
*/
|
||||
logoutOauth(token: string): Promise<void>;
|
||||
}
|
||||
|
||||
@@ -47,9 +47,11 @@ class LocalAdmin implements AdminInterface {
|
||||
contactPage: null,
|
||||
group: null,
|
||||
iframeAuthentication: null,
|
||||
miniLogo: null,
|
||||
loadingLogo: null,
|
||||
loginSceneLogo: null,
|
||||
showPoweredBy: true,
|
||||
loadingCowebsiteLogo: null,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -84,10 +86,14 @@ class LocalAdmin implements AdminInterface {
|
||||
return Promise.reject(new Error("No admin backoffice set!"));
|
||||
}
|
||||
|
||||
getProfileUrl(accessToken: string): string {
|
||||
getProfileUrl(accessToken: string, playUri: string): string {
|
||||
new Error("No admin backoffice set!");
|
||||
return "";
|
||||
}
|
||||
|
||||
async logoutOauth(token: string): Promise<void> {
|
||||
return Promise.reject(new Error("No admin backoffice set!"));
|
||||
}
|
||||
}
|
||||
|
||||
export const localAdmin = new LocalAdmin();
|
||||
|
||||
Reference in New Issue
Block a user