Skip to content

Commit e6ade54

Browse files
committed
feat(dia-backend-auth): queryJWTToken endpoint
1 parent b1ac404 commit e6ade54

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/app/shared/dia-backend/auth/dia-backend-auth.service.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,18 @@ export class DiaBackendAuthService {
128128
);
129129
}
130130

131+
queryJWTToken$() {
132+
return defer(() => this.getAuthHeaders()).pipe(
133+
concatMap(headers => {
134+
return this.httpClient.post<QueryJWTTokenResponse>(
135+
`${BASE_URL}/api/v3/auth/qjwt/`,
136+
{},
137+
{ headers }
138+
);
139+
})
140+
);
141+
}
142+
131143
private readUser$() {
132144
return defer(() => this.getAuthHeaders()).pipe(
133145
concatMap(headers =>
@@ -413,6 +425,11 @@ export interface LoginResponse {
413425
readonly auth_token: string;
414426
}
415427

428+
export interface QueryJWTTokenResponse {
429+
readonly access: string;
430+
readonly refresh: string;
431+
}
432+
416433
export interface ReadUserResponse {
417434
readonly username: string;
418435
readonly email: string;

0 commit comments

Comments
 (0)