Skip to content

Commit

Permalink
fix(templates): correct import & nullable field (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainLanz authored Oct 12, 2022
1 parent 55893f3 commit e6a76a3
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion templates/config/auth.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* file.
*/

import { AuthConfig } from '@ioc:Adonis/Addons/Auth'
import type { AuthConfig } from '@ioc:Adonis/Addons/Auth'

/*
|--------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions templates/middleware/Auth.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GuardsList } from '@ioc:Adonis/Addons/Auth'
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
import { AuthenticationException } from '@adonisjs/auth/build/standalone'
import type { GuardsList } from '@ioc:Adonis/Addons/Auth'
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'

/**
* Auth middleware is meant to restrict un-authenticated access to a given route
Expand Down
2 changes: 1 addition & 1 deletion templates/middleware/SilentAuth.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'

/**
* Silent auth middleware can be used as a global middleware to silent check
Expand Down
2 changes: 1 addition & 1 deletion templates/migrations/api_tokens.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import BaseSchema from '@ioc:Adonis/Lucid/Schema'

export default class {{ tokensSchemaName }} extends BaseSchema {
export default class extends BaseSchema {
protected tableName = '{{ tokensTableName }}'

public async up() {
Expand Down
2 changes: 1 addition & 1 deletion templates/migrations/auth.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import BaseSchema from '@ioc:Adonis/Lucid/Schema'

export default class {{ usersSchemaName }} extends BaseSchema {
export default class extends BaseSchema {
protected tableName = '{{ usersTableName }}'

public async up() {
Expand Down
2 changes: 1 addition & 1 deletion templates/model.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class {{ modelName }} extends BaseModel {
public password: string

@column()
public rememberMeToken?: string
public rememberMeToken: string | null

@column.dateTime({ autoCreate: true })
public createdAt: DateTime
Expand Down

0 comments on commit e6a76a3

Please sign in to comment.