implement
This commit is contained in:
@@ -34,8 +34,9 @@ export const authService = {
|
||||
async getMe() : Promise<User> {
|
||||
const raw = await api.get<any>('/api/User/me')
|
||||
// backend User may have fields like userName / UserName and email / Email
|
||||
const userId = raw?.userId ?? ''
|
||||
const username = raw?.userName ?? raw?.UserName ?? raw?.username ?? raw?.name ?? ''
|
||||
const email = raw?.email ?? raw?.Email ?? ''
|
||||
return { username, email }
|
||||
return { userId, username, email }
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user