Skip to content
Discussion options

You must be logged in to vote

@abcd-ca @dasveloper
This should work:

async signIn(user)​​ ​{​
  ​if​ ​(!user.id)​ ​{​
    ​throw new​ ​Error("Sorry, I couldn't find that user");​
  ​}​
  ​return​ ​true)​
​}

Or if you really want an arrow function:

signIn​: async (user)​​ ​=> {​
  ​if​ ​(!user.id)​ ​{​
    ​throw new​ ​Error("Sorry, I couldn't find that user");​
  ​}​
  ​return​ ​true)​
​}

@abcd-ca I believe your code should look something like this:

async signIn(user, account, profile) {
  try {
   await openDBConnection()
   const allowed = await userIsOnWhitelist(user.email)
   await knex.destroy()
   return allowed
  } catch(error) {
    throw error // Throwing the error further to `next-au…

Replies: 5 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@abcd-ca
Comment options

@balazsorban44
Comment options

@abcd-ca
Comment options

@balazsorban44
Comment options

@abcd-ca
Comment options

Answer selected by balazsorban44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #825 on December 07, 2020 20:08.