mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-04 14:22:00 +01:00
26 lines
484 B
JavaScript
26 lines
484 B
JavaScript
|
import { httpClientFactory } from '@/services/httpClientFactory'
|
||
|
|
||
|
const webClient = httpClientFactory('web')
|
||
|
const apiClient = httpClientFactory('api')
|
||
|
|
||
|
export default {
|
||
|
/**
|
||
|
*
|
||
|
*/
|
||
|
logout() {
|
||
|
return webClient.get('/user/logout')
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
*/
|
||
|
async getCurrentUser() {
|
||
|
try {
|
||
|
const { data } = await apiClient.get('/user')
|
||
|
return data
|
||
|
} catch (error) {
|
||
|
return null
|
||
|
}
|
||
|
},
|
||
|
|
||
|
}
|