Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
ec26a970
Unverified
Commit
ec26a970
authored
May 26, 2023
by
boojack
Committed by
GitHub
May 26, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: sso templates (#1753)
parent
dbe8aa1d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
81 deletions
+82
-81
CreateIdentityProviderDialog.tsx
web/src/components/CreateIdentityProviderDialog.tsx
+82
-81
No files found.
web/src/components/CreateIdentityProviderDialog.tsx
View file @
ec26a970
...
@@ -8,14 +8,7 @@ import { generateDialog } from "./Dialog";
...
@@ -8,14 +8,7 @@ import { generateDialog } from "./Dialog";
import
Icon
from
"./Icon"
;
import
Icon
from
"./Icon"
;
import
{
useTranslation
}
from
"react-i18next"
;
import
{
useTranslation
}
from
"react-i18next"
;
interface
Props
extends
DialogProps
{
const
templateList
:
IdentityProvider
[]
=
[
identityProvider
?:
IdentityProvider
;
confirmCallback
?:
()
=>
void
;
}
const
CreateIdentityProviderDialog
:
React
.
FC
<
Props
>
=
(
props
:
Props
)
=>
{
const
{
t
}
=
useTranslation
();
const
templateList
:
IdentityProvider
[]
=
[
{
{
id
:
UNKNOWN_ID
,
id
:
UNKNOWN_ID
,
name
:
"GitHub"
,
name
:
"GitHub"
,
...
@@ -30,9 +23,9 @@ const CreateIdentityProviderDialog: React.FC<Props> = (props: Props) => {
...
@@ -30,9 +23,9 @@ const CreateIdentityProviderDialog: React.FC<Props> = (props: Props) => {
userInfoUrl
:
"https://api.github.com/user"
,
userInfoUrl
:
"https://api.github.com/user"
,
scopes
:
[
"user"
],
scopes
:
[
"user"
],
fieldMapping
:
{
fieldMapping
:
{
identifier
:
t
(
"setting.sso-section.identifier"
)
,
identifier
:
"login"
,
displayName
:
"
"
,
displayName
:
"name
"
,
email
:
"
"
,
email
:
"email
"
,
},
},
},
},
},
},
...
@@ -51,9 +44,9 @@ const CreateIdentityProviderDialog: React.FC<Props> = (props: Props) => {
...
@@ -51,9 +44,9 @@ const CreateIdentityProviderDialog: React.FC<Props> = (props: Props) => {
userInfoUrl
:
"https://gitlab.com/oauth/userinfo"
,
userInfoUrl
:
"https://gitlab.com/oauth/userinfo"
,
scopes
:
[
"openid"
],
scopes
:
[
"openid"
],
fieldMapping
:
{
fieldMapping
:
{
identifier
:
t
(
"setting.sso-section.identifier"
)
,
identifier
:
"name"
,
displayName
:
"
"
,
displayName
:
"name
"
,
email
:
"
"
,
email
:
"email
"
,
},
},
},
},
},
},
...
@@ -72,16 +65,16 @@ const CreateIdentityProviderDialog: React.FC<Props> = (props: Props) => {
...
@@ -72,16 +65,16 @@ const CreateIdentityProviderDialog: React.FC<Props> = (props: Props) => {
userInfoUrl
:
"https://www.googleapis.com/oauth2/v2/userinfo"
,
userInfoUrl
:
"https://www.googleapis.com/oauth2/v2/userinfo"
,
scopes
:
[
"https://www.googleapis.com/auth/userinfo.email"
,
"https://www.googleapis.com/auth/userinfo.profile"
],
scopes
:
[
"https://www.googleapis.com/auth/userinfo.email"
,
"https://www.googleapis.com/auth/userinfo.profile"
],
fieldMapping
:
{
fieldMapping
:
{
identifier
:
t
(
"setting.sso-section.identifier"
)
,
identifier
:
"email"
,
displayName
:
"
"
,
displayName
:
"name
"
,
email
:
"
"
,
email
:
"email
"
,
},
},
},
},
},
},
},
},
{
{
id
:
UNKNOWN_ID
,
id
:
UNKNOWN_ID
,
name
:
t
(
"setting.sso-section.custom"
)
,
name
:
"Custom"
,
type
:
"OAUTH2"
,
type
:
"OAUTH2"
,
identifierFilter
:
""
,
identifierFilter
:
""
,
config
:
{
config
:
{
...
@@ -100,7 +93,15 @@ const CreateIdentityProviderDialog: React.FC<Props> = (props: Props) => {
...
@@ -100,7 +93,15 @@ const CreateIdentityProviderDialog: React.FC<Props> = (props: Props) => {
},
},
},
},
},
},
];
];
interface
Props
extends
DialogProps
{
identityProvider
?:
IdentityProvider
;
confirmCallback
?:
()
=>
void
;
}
const
CreateIdentityProviderDialog
:
React
.
FC
<
Props
>
=
(
props
:
Props
)
=>
{
const
{
t
}
=
useTranslation
();
const
identityProviderTypes
=
[...
new
Set
(
templateList
.
map
((
t
)
=>
t
.
type
))];
const
identityProviderTypes
=
[...
new
Set
(
templateList
.
map
((
t
)
=>
t
.
type
))];
const
{
confirmCallback
,
destroy
,
identityProvider
}
=
props
;
const
{
confirmCallback
,
destroy
,
identityProvider
}
=
props
;
const
[
basicInfo
,
setBasicInfo
]
=
useState
({
const
[
basicInfo
,
setBasicInfo
]
=
useState
({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment