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
31 lines (24 loc) · 1 KB
/
SignoutRequest.js
File metadata and controls
31 lines (24 loc) · 1 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
// 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';
import UrlUtility from './UrlUtility';
import State from './State';
export default class SignoutRequest {
constructor({url, id_token_hint, post_logout_redirect_uri, data}) {
if (!url) {
Log.error("No url passed to SignoutRequest");
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);
}
}
this.url = url;
}
}