Skip to content

Commit 53d2889

Browse files
committed
replace session close with leave
1 parent 8fd2ebe commit 53d2889

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/services/authService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const authService = {
1717
// Close session on failure locally if we created it strictly for this call
1818
// In the original code, we passed 's' back to the store.
1919
// We will return the session so the store can manage it (keep it open for verify).
20-
await s.close().catch(console.error)
20+
await s.leave().catch(console.error)
2121
throw err
2222
}
2323
},

src/stores/auth.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const useAuthStore = defineStore('auth', () => {
7777
if (s) {
7878
// If we created a temporary session, or if we want to clean up anyway:
7979
// The original logic closed it.
80-
await s.close().catch(console.error)
80+
await s.leave().catch(console.error)
8181
}
8282
if (session.value === s || createdNewSession) {
8383
session.value = null
@@ -129,7 +129,7 @@ export const useAuthStore = defineStore('auth', () => {
129129
)
130130

131131
if (newSession) {
132-
await newSession.close().catch(console.error)
132+
await newSession.leave().catch(console.error)
133133
}
134134
session.value = null
135135
return result
@@ -145,7 +145,7 @@ export const useAuthStore = defineStore('auth', () => {
145145

146146
const userDetails = result.args[0]
147147
if (!userDetails || !userDetails.id) {
148-
await s.close()
148+
await s.leave()
149149
throw new Error('Invalid user details received')
150150
}
151151

@@ -210,7 +210,7 @@ export const useAuthStore = defineStore('auth', () => {
210210

211211
const userDetails = result.args[0]
212212
if (!userDetails || !userDetails.id) {
213-
await s.close()
213+
await s.leave()
214214
return false
215215
}
216216

@@ -226,7 +226,7 @@ export const useAuthStore = defineStore('auth', () => {
226226
}
227227

228228
function logout() {
229-
session.value?.close().catch(console.error)
229+
session.value?.leave().catch(console.error)
230230
session.value = null
231231
setUser(null)
232232
localStorage.removeItem('last_active_user')

0 commit comments

Comments
 (0)