* chore: completed base auth implementation with redirectUrl * chore: completed base auth fix with redirect_uri * chore: added whitelist based redirection * chore: added a env variable for session secret in main.ts * chore: removed migrations folder from prisma directory
16 lines
386 B
TypeScript
16 lines
386 B
TypeScript
import { ExecutionContext, Injectable } from '@nestjs/common';
|
|
import { AuthGuard } from '@nestjs/passport';
|
|
|
|
@Injectable()
|
|
export class GithubSSOGuard extends AuthGuard('github') {
|
|
getAuthenticateOptions(context: ExecutionContext) {
|
|
const req = context.switchToHttp().getRequest();
|
|
|
|
return {
|
|
state: {
|
|
redirect_uri: req.query.redirect_uri,
|
|
},
|
|
};
|
|
}
|
|
}
|