File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,11 @@ class Auth {
19
19
. post ( `${ authUrl } /signup` , { email, password } )
20
20
. set ( 'accept' , 'json' )
21
21
. set ( 'apikey' , this . supabaseKey )
22
- return response
22
+ return this . login ( email , password )
23
23
}
24
24
25
25
this . login = async ( email , password ) => {
26
+ this . removeSavedSession ( ) // clean out the old session before attempting
26
27
let response = await superagent
27
28
. post ( `${ authUrl } /token?grant_type=password` , { email, password } )
28
29
. set ( 'accept' , 'json' )
@@ -104,7 +105,7 @@ class Auth {
104
105
105
106
this . removeSavedSession = ( ) => {
106
107
this . currentUser = null
107
- this . accessToken = null
108
+ this . accessToken = this . supabaseKey
108
109
isBrowser ( ) && localStorage . removeItem ( storageKey )
109
110
}
110
111
You can’t perform that action at this time.
0 commit comments