2020-06-18 17:59:31 +02:00
|
|
|
export const getAppId = cookie => {
|
|
|
|
const base64Token = cookie
|
2020-06-12 21:42:55 +02:00
|
|
|
.split(";")
|
2020-06-18 17:59:31 +02:00
|
|
|
.find(c => c.trim().startsWith("budibase:token"))
|
2020-06-12 21:42:55 +02:00
|
|
|
.split("=")[1]
|
2020-06-18 17:59:31 +02:00
|
|
|
|
|
|
|
const user = JSON.parse(atob(base64Token.split(".")[1]))
|
|
|
|
return user.appId
|
|
|
|
}
|