File tree 2 files changed +38
-0
lines changed
2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ Model functions used by the authorization code grant:
37
37
- :ref: `Model#saveAuthorizationCode `
38
38
- :ref: `Model#revokeAuthorizationCode `
39
39
- :ref: `Model#validateScope `
40
+ - :ref: `Model#validateRedirectUri `
40
41
41
42
--------
42
43
Original file line number Diff line number Diff line change @@ -985,3 +985,40 @@ Returns ``true`` if the access token passes, ``false`` otherwise.
985
985
return requestedScopes.every(s => authorizedScopes.indexOf(s) >= 0);
986
986
}
987
987
988
+ --------
989
+
990
+ .. _Model#validateRedirectUri :
991
+
992
+ ``validateRedirectUri(redirect_uri, redirect_uris, [callback]) ``
993
+ ================================================================
994
+
995
+ Invoked to check if the provided ``redirect_uri `` is valid for a particular ``client ``.
996
+
997
+ This model function is **optional **. If not implemented, the redirect_uri should be included in the provided redirect_uris of the client.
998
+
999
+ **Invoked during: **
1000
+
1001
+ - ``authorization_code `` grant
1002
+
1003
+ **Arguments: **
1004
+
1005
+ +-----------------+----------+---------------------------------------------------------------------+
1006
+ | Name | Type | Description |
1007
+ +=================+==========+=====================================================================+
1008
+ | redirect_uri | String | The redirect URI to validate. |
1009
+ +-----------------+----------+---------------------------------------------------------------------+
1010
+ | redirect_uris | Array | The list of redirect URIs configured for the client. |
1011
+ +-----------------+----------+---------------------------------------------------------------------+
1012
+
1013
+ **Return value: **
1014
+
1015
+ Returns ``true `` if the ``redirect_uri `` is valid, ``false `` otherwise.
1016
+
1017
+ **Remarks: **
1018
+
1019
+ ::
1020
+
1021
+ function validateRedirectUri(redirect_uri, redirect_uris) {
1022
+ return redirect_uris.includes(redirect_uri);
1023
+ }
1024
+
You can’t perform that action at this time.
0 commit comments