mirror of
https://github.com/koush/scrypted.git
synced 2026-02-12 10:02:04 +00:00
client: fix cloud/local login redirect flow
This commit is contained in:
4
packages/client/package-lock.json
generated
4
packages/client/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/client",
|
||||
"version": "1.0.50",
|
||||
"version": "1.0.53",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/client",
|
||||
"version": "1.0.50",
|
||||
"version": "1.0.53",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@scrypted/types": "^0.0.88",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/client",
|
||||
"version": "1.0.50",
|
||||
"version": "1.0.53",
|
||||
"description": "",
|
||||
"main": "dist/packages/client/src/index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -119,9 +119,15 @@ export class ScryptedClientLoginError extends Error {
|
||||
}
|
||||
}
|
||||
|
||||
export function redirectScryptedLogin(baseUrl?: string) {
|
||||
export function redirectScryptedLogin(options?: {
|
||||
redirect?: string, baseUrl?: string
|
||||
}) {
|
||||
let { baseUrl, redirect } = options || {};
|
||||
baseUrl = baseUrl || '';
|
||||
window.location.href = `${baseUrl}/endpoint/@scrypted/core/public/?redirect_uri=${encodeURIComponent(window.location.href)}`;
|
||||
redirect = redirect || `${baseUrl}/endpoint/@scrypted/core/public/`
|
||||
const redirect_uri = `${redirect}?redirect_uri=${encodeURIComponent(window.location.href)}`;
|
||||
console.log('redirect_uri', redirect_uri);
|
||||
window.location.href = redirect_uri;
|
||||
}
|
||||
|
||||
export async function redirectScryptedLogout(baseUrl?: string) {
|
||||
|
||||
Reference in New Issue
Block a user