-
Notifications
You must be signed in to change notification settings - Fork 64
feat: add APIs for session listing and deletion #1449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+301
−49
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c276809
feat/api to fetch all sessions and delete session
sujitaw ba4ff61
feat/update signin api to store session details
sujitaw 3822565
feat/added prisma migration file for clientInfo column
sujitaw baf9bae
fix/sonarcube comment
sujitaw 63e1349
fix/code rabbit comments
sujitaw 71c6586
fix/rabbit comments
sujitaw de0948c
fix/pr comments
sujitaw 50d718c
fix/changed the package from uaparser to express-parser
sujitaw 69e94cc
feat/update jwt logic to throw 401 if session is deleted
sujitaw c339951
fix/resolve pr comments
sujitaw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
export interface JwtPayload { | ||
iss: string; | ||
sub: string; | ||
aud: string[]; | ||
iat?: number; | ||
exp?: number; | ||
azp: string; | ||
scope: string; | ||
gty?: string; | ||
permissions: string[]; | ||
email?: string | ||
} | ||
iss: string; | ||
sub: string; | ||
aud: string[]; | ||
iat?: number; | ||
exp?: number; | ||
azp: string; | ||
scope: string; | ||
gty?: string; | ||
permissions: string[]; | ||
email?: string; | ||
sid: string; | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,23 +1,29 @@ | ||
import { trim } from '@credebl/common/cast.helper'; | ||
import { IsBoolean, IsEmail, IsNotEmpty, IsOptional, IsString } from 'class-validator'; | ||
|
||
import { ApiProperty } from '@nestjs/swagger'; | ||
import type { Prisma } from '@prisma/client'; | ||
import { Transform } from 'class-transformer'; | ||
import { IsBoolean, IsEmail, IsNotEmpty, IsOptional, IsString } from 'class-validator'; | ||
import { trim } from '@credebl/common/cast.helper'; | ||
|
||
export class LoginUserDto { | ||
@ApiProperty({ example: '[email protected]' }) | ||
@IsEmail({}, { message: 'Please provide a valid email' }) | ||
@IsNotEmpty({ message: 'Email is required' }) | ||
@IsString({ message: 'Email should be a string' }) | ||
@Transform(({ value }) => trim(value)) | ||
email: string; | ||
|
||
@ApiProperty({ example: 'Password@1' }) | ||
@IsOptional() | ||
@IsString({ message: 'password should be string' }) | ||
password?: string; | ||
@ApiProperty({ example: '[email protected]' }) | ||
@IsEmail({}, { message: 'Please provide a valid email' }) | ||
@IsNotEmpty({ message: 'Email is required' }) | ||
@IsString({ message: 'Email should be a string' }) | ||
@Transform(({ value }) => trim(value)) | ||
email: string; | ||
|
||
@ApiProperty({ example: 'Password@1' }) | ||
@IsOptional() | ||
@IsString({ message: 'password should be string' }) | ||
password?: string; | ||
|
||
sujitaw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@ApiProperty({ example: 'false' }) | ||
@IsOptional() | ||
@IsBoolean({ message: 'isPasskey should be boolean' }) | ||
isPasskey?: boolean; | ||
|
||
@ApiProperty({ example: 'false' }) | ||
@IsOptional() | ||
@IsBoolean({ message: 'isPasskey should be boolean' }) | ||
isPasskey?: boolean; | ||
@ApiProperty({ example: 'false' }) | ||
@IsOptional() | ||
clientInfo?: Prisma.JsonValue; | ||
} |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.