mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 07:04:45 -04:00
auth: Integrate suggestions by @davidmehren
Add number type alias TimestampMillis Remove solved ToDos Change AuthToken and AuthTokenDto to use Date Rename authService unit tests Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
e6dc8c7678
commit
a8b46923fd
7 changed files with 149 additions and 93 deletions
|
@ -17,6 +17,7 @@ import { ConsoleLoggerService } from '../../../logger/console-logger.service';
|
|||
import { AuthTokenDto } from '../../../auth/auth-token.dto';
|
||||
import { AuthTokenWithSecretDto } from '../../../auth/auth-token-with-secret.dto';
|
||||
import { AuthService } from '../../../auth/auth.service';
|
||||
import { TimestampMillis } from '../../../utils/timestamp';
|
||||
|
||||
@Controller('tokens')
|
||||
export class TokensController {
|
||||
|
@ -38,10 +39,10 @@ export class TokensController {
|
|||
@Post()
|
||||
async postTokenRequest(
|
||||
@Body('label') label: string,
|
||||
@Body('until') until: number,
|
||||
@Body('validUntil') validUntil: TimestampMillis,
|
||||
): Promise<AuthTokenWithSecretDto> {
|
||||
// ToDo: Get real userName
|
||||
return this.authService.createTokenForUser('hardcoded', label, until);
|
||||
return this.authService.createTokenForUser('hardcoded', label, validUntil);
|
||||
}
|
||||
|
||||
@Delete('/:keyId')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue