diff --git a/adonis-typings/auth.ts b/adonis-typings/auth.ts index 83de727..3e3f14b 100644 --- a/adonis-typings/auth.ts +++ b/adonis-typings/auth.ts @@ -575,6 +575,14 @@ declare module '@ioc:Adonis/Addons/Auth' { options?: OATLoginOptions, ): Promise>> + /** + * Generate token for a user without any verification + */ + generate ( + user: GetProviderRealUser, + options?: OATLoginOptions, + ): Promise>> + /** * Login a user using their id */ diff --git a/src/Guards/Oat/index.ts b/src/Guards/Oat/index.ts index 47bcfb5..1eb9031 100644 --- a/src/Guards/Oat/index.ts +++ b/src/Guards/Oat/index.ts @@ -278,6 +278,13 @@ export class OATGuard extends BaseGuard implements OATGuardContract { return this.login(providerUser.user, options) } + /** + * Generate token for a user. It is merely an alias for `login` + */ + public async generate (user: any, options?: OATLoginOptions) { + return this.login(user, options) + } + /** * Login a user */