forked from DuendeArchive/identity-model-oidc-client-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSignoutRequest.js
More file actions
35 lines (27 loc) · 1.12 KB
/
SignoutRequest.js
File metadata and controls
35 lines (27 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
import { Log } from './Log.js';
import { UrlUtility } from './UrlUtility.js';
import { State } from './State.js';
export class SignoutRequest {
constructor({url, id_token_hint, post_logout_redirect_uri, data, extraQueryParams}) {
if (!url) {
Log.error("SignoutRequest.ctor: No url passed");
throw new Error("url");
}
if (id_token_hint) {
url = UrlUtility.addQueryParam(url, "id_token_hint", id_token_hint);
}
if (post_logout_redirect_uri) {
url = UrlUtility.addQueryParam(url, "post_logout_redirect_uri", post_logout_redirect_uri);
if (data) {
this.state = new State({ data });
url = UrlUtility.addQueryParam(url, "state", this.state.id);
}
}
for(let key in extraQueryParams){
url = UrlUtility.addQueryParam(url, key, extraQueryParams[key])
}
this.url = url;
}
}