mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-02-05 21:20:07 +00:00
update oauth2 (#84)
* update oauth2 * i18n * fix validation * chore: auto-fix linting and formatting issues --------- Co-authored-by: uubulb <uubulb@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { oauth2callback } from "@/api/oauth2"
|
||||
import { getProfile, login as loginRequest } from "@/api/user"
|
||||
import { AuthContextProps } from "@/types"
|
||||
import { createContext, useContext, useEffect, useMemo } from "react"
|
||||
@@ -45,9 +44,8 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
|
||||
}
|
||||
}
|
||||
|
||||
const loginOauth2 = async (provider: string, state: string, code: string) => {
|
||||
const loginOauth2 = async () => {
|
||||
try {
|
||||
await oauth2callback(provider, state, code)
|
||||
const user = await getProfile()
|
||||
user.role = user.role || 0
|
||||
setProfile(user)
|
||||
|
||||
Reference in New Issue
Block a user