update
This commit is contained in:
13
dashboard_js/app/routes/auth/_base64state.js
Normal file
13
dashboard_js/app/routes/auth/_base64state.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { encodeURI, decode } from 'js-base64'
|
||||
|
||||
export function encode(data) {
|
||||
return encodeURI(JSON.stringify(data))
|
||||
}
|
||||
|
||||
export function parse(str) {
|
||||
try {
|
||||
return JSON.parse(decode(str))
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user