document, session item

This commit is contained in:
Max Peintner
2024-12-09 10:48:50 +01:00
parent 68066b99af
commit 2bc7629cca
2 changed files with 16 additions and 6 deletions

View File

@@ -269,6 +269,10 @@ export async function GET(request: NextRequest) {
if (authRequest.prompt.includes(Prompt.SELECT_ACCOUNT)) { if (authRequest.prompt.includes(Prompt.SELECT_ACCOUNT)) {
return gotoAccounts(); return gotoAccounts();
} else if (authRequest.prompt.includes(Prompt.LOGIN)) { } else if (authRequest.prompt.includes(Prompt.LOGIN)) {
/**
* The login prompt instructs the authentication server to prompt the user for re-authentication, regardless of whether the user is already authenticated
*/
// if a hint is provided, skip loginname page and jump to the next page // if a hint is provided, skip loginname page and jump to the next page
if (authRequest.loginHint) { if (authRequest.loginHint) {
try { try {
@@ -299,7 +303,11 @@ export async function GET(request: NextRequest) {
} }
return NextResponse.redirect(loginNameUrl); return NextResponse.redirect(loginNameUrl);
} else if (authRequest.prompt.includes(Prompt.NONE)) { } else if (authRequest.prompt.includes(Prompt.NONE)) {
// NONE prompt - silent authentication /**
* With an OIDC none prompt, the authentication server must not display any authentication or consent user interface pages.
* This means that the user should not be prompted to enter their password again.
* Instead, the server attempts to silently authenticate the user using an existing session or other authentication mechanisms that do not require user interaction
**/
const selectedSession = findValidSession(sessions, authRequest); const selectedSession = findValidSession(sessions, authRequest);
if (!selectedSession || !selectedSession.id) { if (!selectedSession || !selectedSession.id) {

View File

@@ -114,11 +114,13 @@ export function SessionItem({
{verifiedAt && moment(timestampDate(verifiedAt)).fromNow()} {verifiedAt && moment(timestampDate(verifiedAt)).fromNow()}
</span> </span>
) : ( ) : (
<span className="text-xs opacity-80 text-ellipsis"> verifiedAt && (
expired{" "} <span className="text-xs opacity-80 text-ellipsis">
{session.expirationDate && expired{" "}
moment(timestampDate(session.expirationDate)).fromNow()} {session.expirationDate &&
</span> moment(timestampDate(session.expirationDate)).fromNow()}
</span>
)
)} )}
</div> </div>