17 lines
680 B
TypeScript
17 lines
680 B
TypeScript
export const usePathUrl = (redirect_path?: any) => {
|
|
let PATH_URL: any = "";
|
|
if (redirect_path) {
|
|
PATH_URL = `${import.meta.env.VITE_APP_SSO_LOGINURL}?client_id=${
|
|
import.meta.env.VITE_APP_SSO_APPID
|
|
}&redirect_uri=${encodeURIComponent(
|
|
import.meta.env.VITE_REDIRECT_URL + "?redirect_path=" + redirect_path
|
|
)}&response_type=code`;
|
|
return PATH_URL;
|
|
} else {
|
|
PATH_URL = `${import.meta.env.VITE_APP_SSO_LOGINURL}?client_id=${
|
|
import.meta.env.VITE_APP_SSO_APPID
|
|
}&redirect_uri=${encodeURIComponent(import.meta.env.VITE_REDIRECT_URL)}&response_type=code`;
|
|
return PATH_URL;
|
|
}
|
|
};
|