ArboreumDev / credit-union-frontend

Frontend in Next.js + Typescript + GraphQL
https://frontend-two-sandy.vercel.app
1 stars 0 forks source link

Dju/seed fix #215

Closed djudjuu closed 3 years ago

djudjuu commented 3 years ago

fixes make reset-db

make seeds now resets the db and creates users in state:

non kyced & non onboarded kyced & non onboarded kyced & onboarded

djudjuu commented 3 years ago

also I recommedn keeping the those changes to the nextauth.ts file staged, so that you can skip the login-via email address step:


const options = {
  // Configure one or more authentication providers
  providers: [
    Providers.Credentials({
      // The name to display on the sign in form (e.g. 'Sign in with...')
      name: "Arboreum",
      credentials: {
        username: { label: "Email", type: "text", placeholder: "" },
        // password: { label: "Password", type: "password" }
      },
      authorize: async (credentials) => {
        const user = {
          id: 1,
          name: "",
          email: credentials.username,
        }

        if (user) {
          // Any user object returned here will be saved in the JSON Web Token
          return Promise.resolve(user)
        } else {
          return Promise.resolve(null)
        }
      },
    }),
  ],
callbacks: ...
h-vishal commented 3 years ago

also I recommedn keeping the those changes to the nextauth.ts file staged, so that you can skip the login-via email address step:


const options = {
  // Configure one or more authentication providers
  providers: [
    Providers.Credentials({
      // The name to display on the sign in form (e.g. 'Sign in with...')
      name: "Arboreum",
      credentials: {
        username: { label: "Email", type: "text", placeholder: "" },
        // password: { label: "Password", type: "password" }
      },
      authorize: async (credentials) => {
        const user = {
          id: 1,
          name: "",
          email: credentials.username,
        }

        if (user) {
          // Any user object returned here will be saved in the JSON Web Token
          return Promise.resolve(user)
        } else {
          return Promise.resolve(null)
        }
      },
    }),
  ],
callbacks: ...

This should probably be conditional on a configuration flag, maybe we can have passwords with accounts - that way it would not matter if this hits production

djudjuu commented 3 years ago

is included in #219 as well, so we could close that once that is merged