Skip to content

Commit 35e7565

Browse files
committed
fix: change authenticationExpireDuration type from number to string
1 parent 08bda8d commit 35e7565

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface OAuthPluginOptions {
1313
buttonText?: string;
1414
iconOnly?: boolean;
1515
pill?: boolean;
16-
authenticationExpireDuration?: number;
16+
authenticationExpireDuration?: string;
1717
openSignup?: {
1818
enabled?: boolean;
1919
defaultFieldValues?: Record<string, any>;
@@ -171,14 +171,14 @@ export default class OAuthPlugin extends AdminForthPlugin {
171171
};
172172
const toReturn = { allowedLogin: true, error: '' };
173173

174-
const rememberMeDays = this.options.authenticationExpireDuration ?? this.adminforth.config.auth.rememberMeDays;
175-
await this.adminforth.restApi.processLoginCallbacks(adminUser, toReturn, response, { ...extra }, rememberMeDays);
174+
const rememberMeDuration = this.options.authenticationExpireDuration ?? this.adminforth.config.auth.rememberMeDuration;
175+
await this.adminforth.restApi.processLoginCallbacks(adminUser, toReturn, response, { ...extra }, rememberMeDuration);
176176
if (toReturn.allowedLogin) {
177177
this.adminforth.auth.setAuthCookie({
178178
response,
179179
username,
180180
pk: user.id,
181-
expireInDays: rememberMeDays
181+
expireInDuration: rememberMeDuration
182182
});
183183
}
184184
return toReturn;

0 commit comments

Comments
 (0)