File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ declare module 'auth-header' {
55declare module '@solid/oidc-rp' {
66 declare export default class RelyingParty {
77 provider : { url : string } ,
8+ registration : { redirect_uris : Array < String > } ,
89 static from ( data : Object ) : Promise < RelyingParty > ,
910 static register (
1011 issuer : string ,
Original file line number Diff line number Diff line change @@ -71,8 +71,15 @@ export async function getRegisteredRp(
7171 idp : string ,
7272 options : loginOptions
7373) : Promise < RelyingParty > {
74+ // To reuse a possible previous RP,
75+ // it be for the same IDP and redirect URI
7476 let rp = await getStoredRp ( options . storage )
75- if ( ! rp || rp . provider . url !== idp ) {
77+ if (
78+ ! rp ||
79+ rp . provider . url !== idp ||
80+ ! rp . registration . redirect_uris . includes ( options . callbackUri )
81+ ) {
82+ // Register a new RP
7683 rp = await registerRp ( idp , options )
7784 await storeRp ( options . storage , idp , rp )
7885 }
You can’t perform that action at this time.
0 commit comments