Chapters
00:00 - Adding the Remember Me checkbox to our Login Form
02:06 - Adding the Remember Flag to our Validator & WebLogin Action
02:43 - Enabling the Remember Me AdonisJS Feature
04:48 - Testing Our Login
You can find the remember_me_tokens
migration in the documentation, or copy the contents from below.
import { BaseSchema } from '@adonisjs/lucid/schema'
export default class extends BaseSchema {
protected tableName = 'remember_me_tokens'
async up() {
this.schema.createTable(this.tableName, (table) => {
table.increments()
table
.integer('tokenable_id')
.notNullable()
.unsigned()
.references('id')
.inTable('users')
.onDelete('CASCADE')
table.string('hash').notNullable().unique()
table.timestamp('created_at').notNullable()
table.timestamp('updated_at').notNullable()
table.timestamp('expires_at').notNullable()
})
}
async down() {
this.schema.dropTable(this.tableName)
}
}
Join The Discussion! (0 Comments)
Please sign in or sign up for free to join in on the dicussion.
Be the first to Comment!