mirror of
https://github.com/standardnotes/server
synced 2026-08-02 03:16:09 -04:00
feat: refactor auth middleware to handle required and optional cross service token scenarios (#612)
* wip: fix variable name * wip: remove redundant middleware in auth * fix: auth middleware refactor * fix(auth): fetching user for key params * fix(auth): specs * fix(auth): registering session controller endpoints
This commit is contained in:
@@ -22,16 +22,6 @@ export class GetUserKeyParams implements UseCaseInterface {
|
||||
) {}
|
||||
|
||||
async execute(dto: GetUserKeyParamsDTO): Promise<GetUserKeyParamsResponse> {
|
||||
if (dto.authenticatedUser) {
|
||||
this.logger.debug(`Creating key params for authenticated user ${dto.authenticatedUser.email}`)
|
||||
|
||||
const keyParams = await this.createKeyParams(dto, dto.authenticatedUser, true)
|
||||
|
||||
return {
|
||||
keyParams,
|
||||
}
|
||||
}
|
||||
|
||||
let user: User | null = null
|
||||
if (dto.email !== undefined) {
|
||||
const usernameOrError = Username.create(dto.email)
|
||||
|
||||
Reference in New Issue
Block a user