-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix for SSO and Keycloak redirects * Fix for Keycloak * Fix for redirect on logout * Redirect bug * redirect issue * Redirect issue * Redirect issue * Redirect problem * redirect * Logging * Back to implicit * Remove implicit flow * Another hack * Again with NAVSA * Keycloak fix * Keycloak fix * Keycloak fix * Keycloak fix * Keycloak fix * remove logging * Updated to bugfixed @recogito/text + pdf annotator versions --------- Co-authored-by: Rainer Simon <[email protected]> Co-authored-by: Rainer Simon <[email protected]>
- Loading branch information
1 parent
6bcc42f
commit 63bd329
Showing
15 changed files
with
1,778 additions
and
1,879 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { useEffect } from 'react'; | ||
import type { Translations } from 'src/Types'; | ||
import { supabaseImplicit } from '@backend/supabaseBrowserClient'; | ||
|
||
interface AuthKeycloakProps { | ||
i18n: Translations; | ||
} | ||
export const AuthKeycloak = (props: AuthKeycloakProps) => { | ||
const { t } = props.i18n; | ||
|
||
const url = new URLSearchParams(window.location.search); | ||
let redirectUrl = url.get('redirect-to'); | ||
if (redirectUrl) { | ||
localStorage.setItem('redirect-to', redirectUrl); | ||
} else { | ||
redirectUrl = localStorage.getItem('redirect-to'); | ||
if (redirectUrl && redirectUrl.length === 0) { | ||
redirectUrl = null; | ||
} | ||
} | ||
|
||
useEffect(() => { | ||
supabaseImplicit.auth | ||
.signInWithOAuth({ | ||
provider: 'keycloak', | ||
options: { | ||
scopes: 'openid', | ||
redirectTo: redirectUrl | ||
? redirectUrl | ||
: `/${props.i18n.lang}/projects`, | ||
}, | ||
}) | ||
.then(({ data, error }) => { | ||
if (data?.url) { | ||
localStorage.removeItem('redirect-to'); | ||
window.location.href = data.url; | ||
} else { | ||
console.error(error); | ||
} | ||
}); | ||
}, []); | ||
|
||
return <div className='keycloak-main'>{t['Redirecting']}</div>; | ||
}; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { useEffect } from 'react'; | ||
|
||
export const CheckRedirect = () => { | ||
useEffect(() => { | ||
const redirectUrl = localStorage.getItem('redirect-to'); | ||
|
||
if (redirectUrl && redirectUrl.length > 0) { | ||
localStorage.removeItem('redirect-to'); | ||
window.location.href = redirectUrl; | ||
} | ||
}, []); | ||
|
||
return <div />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './CheckRedirect'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
import { getTranslations } from '@i18n'; | ||
import LoginLayout from '@layouts/login/LoginLayout.astro'; | ||
import { AuthKeycloak } from '@apps/auth-keycloak/AuthKeycloak'; | ||
--- | ||
|
||
<LoginLayout title='' showLogo={true}> | ||
<AuthKeycloak | ||
client:only='react' | ||
i18n={getTranslations(Astro.request, 'auth-login')} | ||
/> | ||
</LoginLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters