feat(OAuth): add 'iss' parameter to OAuth exchange methods for improved provider handling
All checks were successful
Deploy to production / deploy (push) Successful in 1m57s
All checks were successful
Deploy to production / deploy (push) Successful in 1m57s
This commit is contained in:
@@ -72,9 +72,9 @@ class AuthController {
|
||||
}
|
||||
|
||||
async oauthExchange(req, res) {
|
||||
const { code, state } = req.body;
|
||||
const { code, state, iss } = req.body;
|
||||
try {
|
||||
const result = await oauthService.exchangeOAuthLogin({ code, state });
|
||||
const result = await oauthService.exchangeOAuthLogin({ code, state, iss });
|
||||
res.status(200).json(result);
|
||||
} catch (error) {
|
||||
const knownErrors = new Set([
|
||||
@@ -128,7 +128,7 @@ class AuthController {
|
||||
|
||||
async oauthUserExchange(req, res) {
|
||||
const hashedUserId = req.headers.userid || req.query.userid;
|
||||
const { code, state } = req.body;
|
||||
const { code, state, iss } = req.body;
|
||||
try {
|
||||
const User = (await import('../models/community/user.js')).default;
|
||||
const user = await User.findOne({ where: { hashedId: hashedUserId } });
|
||||
@@ -139,7 +139,8 @@ class AuthController {
|
||||
const result = await oauthService.exchangeOAuthLoginForUser({
|
||||
userId: user.id,
|
||||
code,
|
||||
state
|
||||
state,
|
||||
iss
|
||||
});
|
||||
res.status(200).json(result);
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user