Skip to content
Migrating from NextAuth.js v4? Read our migration guide.

models

Account

const Account: {
  access_token: {
     type: DataTypes.STRING;
  };
  expires_at: {
     type: DataTypes.INTEGER;
  };
  id: {
     defaultValue: DataTypes.UUIDV4;
     primaryKey: true;
     type: DataTypes.UUID;
  };
  id_token: {
     type: DataTypes.TEXT;
  };
  provider: {
     allowNull: false;
     type: DataTypes.STRING;
  };
  providerAccountId: {
     allowNull: false;
     type: DataTypes.STRING;
  };
  refresh_token: {
     type: DataTypes.STRING;
  };
  scope: {
     type: DataTypes.STRING;
  };
  session_state: {
     type: DataTypes.STRING;
  };
  token_type: {
     type: DataTypes.STRING;
  };
  type: {
     allowNull: false;
     type: DataTypes.STRING;
  };
  userId: {
     type: DataTypes.UUID;
  };
};

Type declaration

access_token

access_token: {
  type: DataTypes.STRING;
};

access_token.type

type: StringDataTypeConstructor = DataTypes.STRING;

expires_at

expires_at: {
  type: DataTypes.INTEGER;
};

expires_at.type

type: IntegerDataTypeConstructor = DataTypes.INTEGER;

id

id: {
  defaultValue: DataTypes.UUIDV4;
  primaryKey: true;
  type: DataTypes.UUID;
};

id.defaultValue

defaultValue: AbstractDataTypeConstructor = DataTypes.UUIDV4;

id.primaryKey

primaryKey: boolean = true;

id.type

type: AbstractDataTypeConstructor = DataTypes.UUID;

id_token

id_token: {
  type: DataTypes.TEXT;
};

id_token.type

type: TextDataTypeConstructor = DataTypes.TEXT;

provider

provider: {
  allowNull: false;
  type: DataTypes.STRING;
};

provider.allowNull

allowNull: boolean = false;

provider.type

type: StringDataTypeConstructor = DataTypes.STRING;

providerAccountId

providerAccountId: {
  allowNull: false;
  type: DataTypes.STRING;
};

providerAccountId.allowNull

allowNull: boolean = false;

providerAccountId.type

type: StringDataTypeConstructor = DataTypes.STRING;

refresh_token

refresh_token: {
  type: DataTypes.STRING;
};

refresh_token.type

type: StringDataTypeConstructor = DataTypes.STRING;

scope

scope: {
  type: DataTypes.STRING;
};

scope.type

type: StringDataTypeConstructor = DataTypes.STRING;

session_state

session_state: {
  type: DataTypes.STRING;
};

session_state.type

type: StringDataTypeConstructor = DataTypes.STRING;

token_type

token_type: {
  type: DataTypes.STRING;
};

token_type.type

type: StringDataTypeConstructor = DataTypes.STRING;

type

type: {
  allowNull: false;
  type: DataTypes.STRING;
};

type.allowNull

allowNull: boolean = false;

type.type

type: StringDataTypeConstructor = DataTypes.STRING;

userId

userId: {
  type: DataTypes.UUID;
};

userId.type

type: AbstractDataTypeConstructor = DataTypes.UUID;

Session

const Session: {
  expires: {
     allowNull: false;
     type: DataTypes.DATE;
  };
  id: {
     defaultValue: DataTypes.UUIDV4;
     primaryKey: true;
     type: DataTypes.UUID;
  };
  sessionToken: {
     allowNull: false;
     type: DataTypes.STRING;
     unique: "sessionToken";
  };
  userId: {
     type: DataTypes.UUID;
  };
};

Type declaration

expires

expires: {
  allowNull: false;
  type: DataTypes.DATE;
};

expires.allowNull

allowNull: boolean = false;

expires.type

type: DateDataTypeConstructor = DataTypes.DATE;

id

id: {
  defaultValue: DataTypes.UUIDV4;
  primaryKey: true;
  type: DataTypes.UUID;
};

id.defaultValue

defaultValue: AbstractDataTypeConstructor = DataTypes.UUIDV4;

id.primaryKey

primaryKey: boolean = true;

id.type

type: AbstractDataTypeConstructor = DataTypes.UUID;

sessionToken

sessionToken: {
  allowNull: false;
  type: DataTypes.STRING;
  unique: "sessionToken";
};

sessionToken.allowNull

allowNull: boolean = false;

sessionToken.type

type: StringDataTypeConstructor = DataTypes.STRING;

sessionToken.unique

unique: string = "sessionToken";

userId

userId: {
  type: DataTypes.UUID;
};

userId.type

type: AbstractDataTypeConstructor = DataTypes.UUID;

User

const User: {
  email: {
     type: DataTypes.STRING;
     unique: "email";
  };
  emailVerified: {
     type: DataTypes.DATE;
  };
  id: {
     defaultValue: DataTypes.UUIDV4;
     primaryKey: true;
     type: DataTypes.UUID;
  };
  image: {
     type: DataTypes.STRING;
  };
  name: {
     type: DataTypes.STRING;
  };
};

Type declaration

email

email: {
  type: DataTypes.STRING;
  unique: "email";
};

email.type

type: StringDataTypeConstructor = DataTypes.STRING;

email.unique

unique: string = "email";

emailVerified

emailVerified: {
  type: DataTypes.DATE;
};

emailVerified.type

type: DateDataTypeConstructor = DataTypes.DATE;

id

id: {
  defaultValue: DataTypes.UUIDV4;
  primaryKey: true;
  type: DataTypes.UUID;
};

id.defaultValue

defaultValue: AbstractDataTypeConstructor = DataTypes.UUIDV4;

id.primaryKey

primaryKey: boolean = true;

id.type

type: AbstractDataTypeConstructor = DataTypes.UUID;

image

image: {
  type: DataTypes.STRING;
};

image.type

type: StringDataTypeConstructor = DataTypes.STRING;

name

name: {
  type: DataTypes.STRING;
};

name.type

type: StringDataTypeConstructor = DataTypes.STRING;

VerificationToken

const VerificationToken: {
  expires: {
     allowNull: false;
     type: DataTypes.DATE;
  };
  identifier: {
     allowNull: false;
     type: DataTypes.STRING;
  };
  token: {
     primaryKey: true;
     type: DataTypes.STRING;
  };
};

Type declaration

expires

expires: {
  allowNull: false;
  type: DataTypes.DATE;
};

expires.allowNull

allowNull: boolean = false;

expires.type

type: DateDataTypeConstructor = DataTypes.DATE;

identifier

identifier: {
  allowNull: false;
  type: DataTypes.STRING;
};

identifier.allowNull

allowNull: boolean = false;

identifier.type

type: StringDataTypeConstructor = DataTypes.STRING;

token

token: {
  primaryKey: true;
  type: DataTypes.STRING;
};

token.primaryKey

primaryKey: boolean = true;

token.type

type: StringDataTypeConstructor = DataTypes.STRING;
Auth.js © Balázs Orbán and Team - 2024