UNPKG

1.43 kBJavaScriptView Raw
1"use strict";
2/*
3 * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
6 * the License. A copy of the License is located at
7 *
8 * http://aws.amazon.com/apache2.0/
9 *
10 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
12 * and limitations under the License.
13 */
14Object.defineProperty(exports, "__esModule", { value: true });
15exports.setState = function (state) {
16 window.sessionStorage.setItem('oauth_state', state);
17};
18exports.getState = function () {
19 var oauth_state = window.sessionStorage.getItem('oauth_state');
20 window.sessionStorage.removeItem('oauth_state');
21 return oauth_state;
22};
23exports.setPKCE = function (private_key) {
24 window.sessionStorage.setItem('ouath_pkce_key', private_key);
25};
26exports.getPKCE = function () {
27 var ouath_pkce_key = window.sessionStorage.getItem('ouath_pkce_key');
28 window.sessionStorage.removeItem('ouath_pkce_key');
29 return ouath_pkce_key;
30};
31exports.clearAll = function () {
32 window.sessionStorage.removeItem('ouath_pkce_key');
33 window.sessionStorage.removeItem('oauth_state');
34};
35//# sourceMappingURL=oauthStorage.js.map
\No newline at end of file