Always return scope
This commit is contained in:
@@ -92,14 +92,15 @@ export class GoogleAuthProvider
|
||||
'google',
|
||||
refreshToken,
|
||||
params,
|
||||
(err, accessToken) => {
|
||||
(err, accessToken, _, params) => {
|
||||
if (err || !accessToken) {
|
||||
return res.status(401).send('Failed to refresh access token');
|
||||
}
|
||||
|
||||
return res.send({
|
||||
accessToken,
|
||||
expiresInSeconds: 36000,
|
||||
idToken: params.id_token,
|
||||
expiresInSeconds: params.expires_in,
|
||||
scope: params.scope,
|
||||
});
|
||||
},
|
||||
);
|
||||
@@ -121,6 +122,7 @@ export class GoogleAuthProvider
|
||||
idToken: params.id_token,
|
||||
accessToken,
|
||||
refreshToken,
|
||||
scope: params.scope,
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
@@ -58,16 +58,25 @@ export type AuthProviderFactory = {
|
||||
new (providerConfig: any): AuthProvider & AuthProviderRouteHandlers;
|
||||
};
|
||||
|
||||
export type AuthInfo = {
|
||||
profile: passport.Profile;
|
||||
export type AuthInfoBase = {
|
||||
accessToken: string;
|
||||
idToken?: string;
|
||||
expiresInSeconds?: number;
|
||||
scope: string;
|
||||
};
|
||||
|
||||
export type AuthInfoWithProfile = AuthInfoBase & {
|
||||
profile: passport.Profile;
|
||||
};
|
||||
|
||||
export type AuthInfoPrivate = AuthInfoWithProfile & {
|
||||
refreshToken: string;
|
||||
};
|
||||
|
||||
export type AuthResponse =
|
||||
| {
|
||||
type: 'auth-result';
|
||||
payload: AuthInfo;
|
||||
payload: AuthInfoBase | AuthInfoWithProfile;
|
||||
}
|
||||
| {
|
||||
type: 'auth-result';
|
||||
|
||||
Reference in New Issue
Block a user