@adonisjs/auth
Advanced tools
Comparing version 4.2.2 to 4.2.3
@@ -60,4 +60,16 @@ "use strict"; | ||
const { name, user_id, token: value, expires_at, type, ...meta } = tokenRow; | ||
const expiresAt = expires_at ? luxon_1.DateTime.fromFormat(expires_at, client.dialect.dateTimeFormat) : undefined; | ||
let expiresAt; | ||
/** | ||
* Parse dialect date to an instance of Luxon | ||
*/ | ||
if (expires_at instanceof Date) { | ||
expiresAt = luxon_1.DateTime.fromJSDate(expires_at); | ||
} | ||
else if (expires_at && typeof (expires_at) === 'string') { | ||
expiresAt = luxon_1.DateTime.fromFormat(expires_at, client.dialect.dateTimeFormat); | ||
} | ||
else if (expires_at && typeof (expires_at) === 'number') { | ||
expiresAt = luxon_1.DateTime.fromMillis(expires_at); | ||
} | ||
/** | ||
* Ensure token isn't expired | ||
@@ -64,0 +76,0 @@ */ |
@@ -9,3 +9,3 @@ import BaseSchema from '@ioc:Adonis/Lucid/Schema' | ||
table.increments('id').primary() | ||
table.integer('user_id').references('id').inTable('users').onDelete('CASCADE') | ||
table.integer('user_id').unsigned().references('id').inTable('users').onDelete('CASCADE') | ||
table.string('name').notNullable() | ||
@@ -12,0 +12,0 @@ table.string('type').notNullable() |
{ | ||
"name": "@adonisjs/auth", | ||
"version": "4.2.2", | ||
"version": "4.2.3", | ||
"description": "Offical authentication provider for Adonis framework", | ||
@@ -5,0 +5,0 @@ "types": "build/adonis-typings/index.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138488
3709