-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Keycloak Backend Integration (#179)
* chore: Update to @mean-stream/nestx v0.12 * feat(backend): Set up auth * feat(backend): Save creator user in polls * fix(backend): Add missing poll properties * feat(backend): Save user in participants * chore: Fix lint problems --------- Co-authored-by: Julian Holfeld <morphclue@gmail.com> Co-authored-by: Clashsoft <Clashsoft@users.noreply.github.com>
- Loading branch information
1 parent
30d8aa2
commit 077c1ff
Showing
9 changed files
with
262 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {Injectable} from '@nestjs/common'; | ||
import {AuthGuard} from '@nestjs/passport'; | ||
|
||
@Injectable() | ||
export class OptionalAuthGuard extends AuthGuard('jwt') { | ||
handleRequest(err: any, user: any) { | ||
if (err) { | ||
throw err; // the default implementation checks if user is falsy and throws an UnauthorizedException | ||
} | ||
return user; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.