Skip to content

Commit 9d36748

Browse files
committed
fix: review comments
1 parent 5d3008f commit 9d36748

File tree

5 files changed

+48
-229
lines changed

5 files changed

+48
-229
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"reflect-metadata": "^0.1.13",
7171
"secure-random-password": "^0.2.3",
7272
"semver": "^7.3.5",
73-
"sqlite3": "^5.0.2",
73+
"sqlite3": "^5.1.1",
7474
"swagger-ui-express": "^4.3.0",
7575
"swr": "^1.2.2",
7676
"typeorm": "0.2.45",

server/routes/auth.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -476,18 +476,21 @@ authRoutes.get('/oidc-callback', async (req, res, next) => {
476476
// Fetch the token data
477477
const callbackUrl = new URL(
478478
'/api/v1/auth/oidc-callback',
479-
`http://${req.headers.host}`
479+
`${req.protocol}://${req.headers.host}`
480480
);
481+
482+
const formData = new URLSearchParams();
483+
formData.append('client_secret', oidcClientSecret);
484+
formData.append('grant_type', 'authorization_code');
485+
formData.append('redirect_uri', callbackUrl.toString());
486+
formData.append('client_id', oidcClientId);
487+
formData.append('code', code);
481488
const response = await fetch(wellKnownInfo.token_endpoint, {
482489
method: 'POST',
483-
headers: new Headers([['Content-Type', 'application/json']]),
484-
body: JSON.stringify({
485-
client_cecret: oidcClientSecret,
486-
grant_type: 'authorization_code',
487-
redirect_uri: callbackUrl,
488-
client_id: oidcClientId,
489-
code,
490-
}),
490+
headers: new Headers([
491+
['Content-Type', 'application/x-www-form-urlencoded'],
492+
]),
493+
body: formData,
491494
});
492495

493496
// Check that the response is valid

src/components/Login/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const messages = defineMessages({
2020
signinheader: 'Sign in to continue',
2121
signinwithplex: 'Use your Plex account',
2222
signinwithoverseerr: 'Use your {applicationTitle} account',
23-
signinwithoidc: 'Use your {oidcName} account',
23+
signinwithoidcaccount: 'Use your {oidcName} account',
2424
});
2525

2626
const Login: React.FC = () => {
@@ -169,7 +169,7 @@ const Login: React.FC = () => {
169169
}`}
170170
onClick={() => handleClick(2)}
171171
>
172-
{intl.formatMessage(messages.signinwithoidc, {
172+
{intl.formatMessage(messages.signinwithoidcaccount, {
173173
oidcName: settings.currentSettings.oidcName,
174174
})}
175175
</button>

src/components/Settings/SettingsUsers/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ const validationSchema = yup.object().shape({
5959
test: (val) => {
6060
return (
6161
!!val &&
62-
/^(?!:\/\/)([a-zA-Z0-9-_]+\.)*[a-zA-Z0-9][a-zA-Z0-9-_]+\.[a-zA-Z]{2,11}?$/.test(
63-
val
64-
)
62+
// Any HTTPS domain without query string
63+
/^([a-zA-Z0-9-_]+\.)[^?]+$/i.test(val)
6564
);
6665
},
6766
}),

0 commit comments

Comments
 (0)