Skip to content

Commit bcdda82

Browse files
feat: allow normal users to log in
1 parent f5488f5 commit bcdda82

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/support/appwrite-utils.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,14 @@ export const getKeyObject = async () => {
3333
*/
3434
const getExistingUserSession = async (account, client) => {
3535
const currentUser = await account.get()
36+
const hasAccount = currentUser.name !== '' &&
37+
currentUser.email !== '' &&
38+
currentUser.emailVerification === true &&
39+
currentUser.labels.length
3640
const databases = new Databases(client)
3741
return await databases.getDocument(
3842
'tyk_integration',
39-
'anonymous_keys',
43+
hasAccount ? 'basic_keys' : 'anonymous_keys',
4044
currentUser.$id
4145
)
4246
}

0 commit comments

Comments
 (0)