mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
feat: add loggedIn checks for frontend
This commit is contained in:
1 parent
34c277c886
commit
d939b7eb4d
5 files changed
+37
-21
No files matched your search
@@ -1,5 +1,11 @@
|
||||
import api from './api'
|
||||
|
||||
export async function isLoggedIn() {
|
||||
const res = await api.get('/auth/check-session')
|
||||
const { loggedIn } = res.data
|
||||
return loggedIn
|
||||
}
|
||||
|
||||
export const login = async (username, password) => {
|
||||
try {
|
||||
const res = await api.post('/auth/login', { username, password })
|
||||
|
||||
Reference in new issue
Block a user