fix
This commit is contained in:
@@ -96,10 +96,10 @@ router.post("/token", async (req, res) => {
|
|||||||
try {
|
try {
|
||||||
await ensureOIDC();
|
await ensureOIDC();
|
||||||
|
|
||||||
const { code, state, code_verifier, redirect_uri } = req.body;
|
const { code, state, redirect_uri } = req.body;
|
||||||
|
|
||||||
if (!code || !state || !code_verifier || !redirect_uri) {
|
if (!code || !state || !redirect_uri) {
|
||||||
res.status(400).json({ error: "Missing required parameters: code, state, code_verifier, redirect_uri" });
|
res.status(400).json({ error: "Missing required parameters: code, state, redirect_uri" });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -138,13 +138,11 @@ final class AuthService: NSObject {
|
|||||||
request.httpMethod = "POST"
|
request.httpMethod = "POST"
|
||||||
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
|
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
|
||||||
|
|
||||||
// code_verifier is intentionally omitted — the backend uses its own verifier
|
|
||||||
// that was generated during /auth/login and stored in the server-side session.
|
|
||||||
// state is sent so the backend can look up and validate the original session.
|
// state is sent so the backend can look up and validate the original session.
|
||||||
|
// code_verifier is not sent — the backend uses its own verifier from the session.
|
||||||
let body: [String: Any] = [
|
let body: [String: Any] = [
|
||||||
"code": code,
|
"code": code,
|
||||||
"state": state,
|
"state": state,
|
||||||
"code_verifier": "", // kept for API compatibility; backend ignores it
|
|
||||||
"redirect_uri": redirectUri
|
"redirect_uri": redirectUri
|
||||||
]
|
]
|
||||||
request.httpBody = try JSONSerialization.data(withJSONObject: body)
|
request.httpBody = try JSONSerialization.data(withJSONObject: body)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>API_BASE_URL</key>
|
<key>API_BASE_URL</key>
|
||||||
<string>https://timetracker.simon-franken.de/api</string>
|
<string>http://localhost:3001</string>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
|
|||||||
Reference in New Issue
Block a user