mirror of
https://github.com/ditkrg/AuthorizationServerDemos.git
synced 2026-01-22 22:47:02 +00:00
Changes https to http
This commit is contained in:
parent
f993d6f0d0
commit
2108f993bf
@ -17,7 +17,7 @@
|
||||
"tailwindcss": "^2.0.2"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "HTTPS=true react-scripts start",
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
|
||||
@ -1,46 +1,48 @@
|
||||
import { UserManager } from 'oidc-client';
|
||||
import { storeUserError, storeUser } from '../actions/authActions'
|
||||
import { UserManager } from "oidc-client";
|
||||
import { storeUserError, storeUser } from "../actions/authActions";
|
||||
|
||||
const config = {
|
||||
authority: "https://localhost:10000",
|
||||
authority: "http://localhost:10000",
|
||||
client_id: "traffic-police-react-app",
|
||||
redirect_uri: "https://localhost:3000/signin-oidc",
|
||||
redirect_uri: "http://localhost:3000/signin-oidc",
|
||||
response_type: "code",
|
||||
scope: "openid profile traffic-police-api",
|
||||
post_logout_redirect_uri: "https://localhost:3000/signout-oidc",
|
||||
post_logout_redirect_uri: "http://localhost:3000/signout-oidc",
|
||||
};
|
||||
|
||||
const userManager = new UserManager(config)
|
||||
const userManager = new UserManager(config);
|
||||
|
||||
export async function loadUserFromStorage(store) {
|
||||
try {
|
||||
let user = await userManager.getUser()
|
||||
if (!user) { return store.dispatch(storeUserError()) }
|
||||
store.dispatch(storeUser(user))
|
||||
let user = await userManager.getUser();
|
||||
if (!user) {
|
||||
return store.dispatch(storeUserError());
|
||||
}
|
||||
store.dispatch(storeUser(user));
|
||||
} catch (e) {
|
||||
console.error(`User not found: ${e}`)
|
||||
store.dispatch(storeUserError())
|
||||
console.error(`User not found: ${e}`);
|
||||
store.dispatch(storeUserError());
|
||||
}
|
||||
}
|
||||
|
||||
export function signinRedirect() {
|
||||
return userManager.signinRedirect()
|
||||
return userManager.signinRedirect();
|
||||
}
|
||||
|
||||
export function signinRedirectCallback() {
|
||||
return userManager.signinRedirectCallback()
|
||||
return userManager.signinRedirectCallback();
|
||||
}
|
||||
|
||||
export function signoutRedirect() {
|
||||
userManager.clearStaleState()
|
||||
userManager.removeUser()
|
||||
return userManager.signoutRedirect()
|
||||
userManager.clearStaleState();
|
||||
userManager.removeUser();
|
||||
return userManager.signoutRedirect();
|
||||
}
|
||||
|
||||
export function signoutRedirectCallback() {
|
||||
userManager.clearStaleState()
|
||||
userManager.removeUser()
|
||||
return userManager.signoutRedirectCallback()
|
||||
userManager.clearStaleState();
|
||||
userManager.removeUser();
|
||||
return userManager.signoutRedirectCallback();
|
||||
}
|
||||
|
||||
export default userManager
|
||||
export default userManager;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user