Skip to content

Commit 57db98e

Browse files
author
Timo Stark
committed
Fix: unhandled exception if code is not present
In case of an error the `auth_code` will not be sent back from the IdP with the `_codexch` requeset. Checking the length will result in an unhandled exception. Checking undefined before the length.
1 parent 2a01413 commit 57db98e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openid_connect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function auth(r) {
103103

104104
function codeExchange(r) {
105105
// First check that we received an authorization code from the IdP
106-
if (r.variables.arg_code.length == 0) {
106+
if (r.variables.arg_code == undefined || r.variables.arg_code.length == 0) {
107107
if (r.variables.arg_error) {
108108
r.error("OIDC error receiving authorization code from IdP: " + r.variables.arg_error_description);
109109
} else {

0 commit comments

Comments
 (0)