Skip to content

Commit

Permalink
Add auth0 sub in user model
Browse files Browse the repository at this point in the history
  • Loading branch information
flvndvd committed Mar 5, 2024
1 parent 2586ca0 commit a055071
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions front/lib/models/user.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { UserProviderType } from "@dust-tt/types";
import type {
CreationOptional,
ForeignKey,
Expand All @@ -15,8 +16,11 @@ export class User extends Model<
declare id: CreationOptional<number>;
declare createdAt: CreationOptional<Date>;
declare updatedAt: CreationOptional<Date>;
declare provider: "github" | "google";
declare providerId: string;

declare auth0Sub: string | null;
declare provider: UserProviderType;
declare providerId: string | null;

declare username: string;
declare email: string;
declare name: string;
Expand Down Expand Up @@ -45,11 +49,16 @@ User.init(
},
provider: {
type: DataTypes.STRING,
allowNull: false,
allowNull: true,
},
providerId: {
type: DataTypes.STRING,
allowNull: false,
allowNull: true,
},
auth0Sub: {
type: DataTypes.STRING,
// TODO(2024-03-01 flav) Set to false once new login flow is released.
allowNull: true,
},
username: {
type: DataTypes.STRING,
Expand Down

0 comments on commit a055071

Please sign in to comment.