fix unreliable 'successful' flag, don't set content-type on leave_open
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-01-04 13:39:00 +01:00
parent dab45e39a6
commit d28be9e3f8
3 changed files with 32 additions and 4 deletions

View File

@ -86,7 +86,7 @@ class AuthRequest {
data,
leave_open
}: AccessSettings): Promise<AccessResult> {
this.default_header (typeof redirect_to !== 'string');
this.default_header (typeof redirect_to !== 'string' && !leave_open);
const at = await auth.sign (
'access_token',
@ -122,6 +122,8 @@ class AuthRequest {
result.refresh_token_id = rt.id;
}
this._is_successful = true;
if (typeof redirect_to === 'string') {
this.response.setHeader ('Location', redirect_to);
this.response.statusCode = 302;
@ -135,7 +137,6 @@ class AuthRequest {
this.response.end (JSON.stringify (res));
}
this._is_successful = true;
return result;
}