forked from noxious/client
hmm
This commit is contained in:
parent
4d58801897
commit
236b091216
@ -16,7 +16,10 @@ export async function register(username: string, password: string, socketStore =
|
|||||||
export async function login(username: string, password: string, socketStore = useSocketStore()) {
|
export async function login(username: string, password: string, socketStore = useSocketStore()) {
|
||||||
try {
|
try {
|
||||||
const response = await axios.post(`${config.server_endpoint}/login`, { username, password })
|
const response = await axios.post(`${config.server_endpoint}/login`, { username, password })
|
||||||
useCookies().set('token', response.data.token as string)
|
useCookies().set('token', response.data.token as string, {
|
||||||
|
// for whole domain
|
||||||
|
domain: window.location.hostname.split('.').slice(-2).join('.'),
|
||||||
|
})
|
||||||
return { success: true, token: response.data.token }
|
return { success: true, token: response.data.token }
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
return { error: error.response.data.message }
|
return { error: error.response.data.message }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user