1st push
This commit is contained in:
parent
501d8a8d8e
commit
3226975910
76 changed files with 48623 additions and 3401 deletions
29
context.js
Normal file
29
context.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import router from "next/router"
|
||||
import { createContext } from "react"
|
||||
import { getlocal, storelocal } from "./localstore"
|
||||
|
||||
export const AuthContext = createContext({
|
||||
isLoggedIn: true,
|
||||
accounttype: true,
|
||||
firebase: null,
|
||||
premium: false,
|
||||
modelopen: false,
|
||||
setModel: () => {},
|
||||
changeaccount: () => {
|
||||
accounttype = !accounttype
|
||||
storelocal("accounttype", accounttype)
|
||||
},
|
||||
checkType: async () => {
|
||||
var at = getlocal("accounttype")
|
||||
accounttype = at
|
||||
},
|
||||
login: () => {
|
||||
isLoggedIn = true
|
||||
},
|
||||
logout: () => {
|
||||
localStorage.removeItem("access_token")
|
||||
localStorage.removeItem("refresh_token")
|
||||
localStorage.removeItem("userdata")
|
||||
isLoggedIn = false
|
||||
},
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue