Files
outline/app/scenes/Login/Notices.js
Greg Linklater 4b2bf28531 feat: Generic OAuth2 Authentication (#2388)
* chore: additional dependency

* feat: OAuth2 authentication provider

* docs: add env vars

* chore: lock file

* feat: add malformed user info error and notice

* feat: configurable scopes

* fix: explicitly enable state and disable pkce

* chore: remove externally supplied username from account provisioner use

* chore: remove upstream error

* chore: add explicit import for fetch

* chore: remove unused env var from sample

* docs: openid connect claims

* fix: forward fetch errors

* feat: configurable team claim name

* docs: move OIDC env vars together

* refactor: change provider name

* refactor: rename error to match provider

* fix: resolve claim using lodash.get

* refactor: remove OIDC_TEAM_CLAIM and hard code team name
2021-09-02 19:50:17 -07:00

78 lines
2.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// @flow
import * as React from "react";
import NoticeAlert from "components/NoticeAlert";
import useQuery from "hooks/useQuery";
export default function Notices() {
const query = useQuery();
const notice = query.get("notice");
const description = query.get("description");
return (
<>
{notice === "google-hd" && (
<NoticeAlert>
Sorry, Google sign in cannot be used with a personal email. Please try
signing in with your Google Workspace account.
</NoticeAlert>
)}
{notice === "maximum-teams" && (
<NoticeAlert>
The team you authenticated with is not authorized on this
installation. Try another?
</NoticeAlert>
)}
{notice === "hd-not-allowed" && (
<NoticeAlert>
Sorry, your Google apps domain is not allowed. Please try again with
an allowed team domain.
</NoticeAlert>
)}
{notice === "malformed_user_info" && (
<NoticeAlert>
We could not read the user info supplied by your identity provider.
</NoticeAlert>
)}
{notice === "email-auth-required" && (
<NoticeAlert>
Your account uses email sign-in, please sign-in with email to
continue.
</NoticeAlert>
)}
{notice === "email-auth-ratelimit" && (
<NoticeAlert>
An email sign-in link was recently sent, please check your inbox or
try again in a few minutes.
</NoticeAlert>
)}
{notice === "auth-error" &&
(description ? (
<NoticeAlert>{description}</NoticeAlert>
) : (
<NoticeAlert>
Authentication failed we were unable to sign you in at this time.
Please try again.
</NoticeAlert>
))}
{notice === "expired-token" && (
<NoticeAlert>
Sorry, it looks like that sign-in link is no longer valid, please try
requesting another.
</NoticeAlert>
)}
{notice === "suspended" && (
<NoticeAlert>
Your Outline account has been suspended. To re-activate your account,
please contact a team admin.
</NoticeAlert>
)}
{notice === "authentication-provider-disabled" && (
<NoticeAlert>
Authentication failed this login method was disabled by a team
admin.
</NoticeAlert>
)}
</>
);
}