Skip to content

Commit

Permalink
feat: allow normal users to log in
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGreatRefrigerator committed Jan 22, 2025
1 parent afb55fd commit d05c034
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/support/appwrite-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ export const getKeyObject = async () => {
*/
const getExistingUserSession = async (account, client) => {
const currentUser = await account.get()
const hasAccount = currentUser.name !== '' &&
currentUser.email !== '' &&
currentUser.emailVerification === true &&
currentUser.labels.length
const databases = new Databases(client)
return await databases.getDocument(
'tyk_integration',
'anonymous_keys',
hasAccount ? 'basic_keys' : 'anonymous_keys',
currentUser.$id
)
}
Expand Down

0 comments on commit d05c034

Please sign in to comment.