fix localuser for OIDC
This commit is contained in:
parent
f053ece7da
commit
ea64e79e46
@ -288,11 +288,14 @@ class ConnectionManager {
|
||||
}
|
||||
const nonce = localUserStore.getNonce();
|
||||
const token = localUserStore.getAuthToken();
|
||||
const { authToken, username } = await Axios.get(`${PUSHER_URL}/login-callback`, { params: { code, nonce, token } }).then(
|
||||
const { authToken, username, userUuid } = await Axios.get(`${PUSHER_URL}/login-callback`, { params: { code, nonce, token } }).then(
|
||||
(res) => res.data
|
||||
);
|
||||
localUserStore.setAuthToken(authToken);
|
||||
|
||||
this.localUser = new LocalUser(userUuid, []);
|
||||
this.authToken = authToken;
|
||||
localUserStore.saveUser(this.localUser);
|
||||
localUserStore.setAuthToken(this.authToken);
|
||||
|
||||
gameManager.setPlayerName(username);
|
||||
|
||||
|
@ -68,7 +68,7 @@ export class AuthenticateController extends BaseController {
|
||||
await openIDClient.checkTokenAuth(authTokenData.hydraAccessToken);
|
||||
res.writeStatus("200");
|
||||
this.addCorsHeaders(res);
|
||||
return res.end(JSON.stringify({ authToken: token, username: authTokenData.username }));
|
||||
return res.end(JSON.stringify({ authToken: token, username: authTokenData.username, userUuid : authTokenData.identifier }));
|
||||
} catch (err) {
|
||||
console.info("User was not connected", err);
|
||||
}
|
||||
@ -83,7 +83,7 @@ export class AuthenticateController extends BaseController {
|
||||
const authToken = jwtTokenManager.createAuthToken(sub, userInfo.access_token, userInfo.username);
|
||||
res.writeStatus("200");
|
||||
this.addCorsHeaders(res);
|
||||
return res.end(JSON.stringify({ authToken: authToken, username: userInfo.username }));
|
||||
return res.end(JSON.stringify({ authToken: authToken, username: userInfo.username, userUuid : sub }));
|
||||
} catch (e) {
|
||||
return this.errorToResponse(e, res);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user