Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Ho <[email protected]>
  • Loading branch information
derek-ho committed Feb 8, 2024
1 parent 183b502 commit a1848b0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 0 additions & 2 deletions server/auth/types/authentication_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ export abstract class AuthenticationType implements IAuthenticationType {
cookie = undefined;
}

console.log(cookie)

if (!cookie || !(await this.isValidCookie(cookie, request))) {
// clear cookie
this.sessionStorageFactory.asScoped(request).clear();
Expand Down
7 changes: 1 addition & 6 deletions server/auth/types/saml/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export class SamlAuthRoutes {
redirectHash: request.query.redirectHash === 'true',
},
};
console.log('saml login cookie' + JSON.stringify(cookie))
this.sessionStorageFactory.asScoped(request).set(cookie);
return response.redirected({
headers: {
Expand Down Expand Up @@ -114,7 +113,6 @@ export class SamlAuthRoutes {
let redirectHash: boolean = false;
try {
const cookie = await this.sessionStorageFactory.asScoped(request).get();
console.log('acs' + JSON.stringify(cookie))
if (cookie) {
requestId = cookie.saml?.requestId || '';
nextUrl =
Expand Down Expand Up @@ -144,20 +142,17 @@ export class SamlAuthRoutes {
credentials.authorization
);

console.log('creds' + JSON.stringify(credentials), 'user' + JSON.stringify(user))

let expiryTime = Date.now() + this.config.session.ttl;
const [headerEncoded, payloadEncoded, signature] = credentials.authorization.split('.');
if (!payloadEncoded) {
context.security_plugin.logger.error('JWT token payload not found');
}
const tokenPayload = JSON.parse(Buffer.from(payloadEncoded, 'base64').toString());
console.log(tokenPayload)

if (tokenPayload.exp) {
expiryTime = parseInt(tokenPayload.exp, 10) * 1000;
}
console.log(expiryTime)
console.log(expiryTime);

const cookie: SecuritySessionCookie = {
username: user.username,
Expand Down

0 comments on commit a1848b0

Please sign in to comment.