chore: Pass sso_account_id to select the account during SSO Login (#4103)

This commit is contained in:
Pranav Raj S
2022-03-03 20:49:51 +05:30
committed by GitHub
parent 11adfd2384
commit 9583a2dbad
8 changed files with 61 additions and 9 deletions

View File

@@ -6,7 +6,7 @@ import authAPI from '../../api/auth';
import createAxios from '../../helper/APIHelper';
import actionCable from '../../helper/actionCable';
import { setUser, getHeaderExpiry, clearCookiesOnLogout } from '../utils/api';
import { DEFAULT_REDIRECT_URL } from '../../constants';
import { getLoginRedirectURL } from '../../helper/URLHelper';
const state = {
currentUser: {
@@ -88,15 +88,16 @@ export const getters = {
// actions
export const actions = {
login({ commit }, credentials) {
login({ commit }, { ssoAccountId, ...credentials }) {
return new Promise((resolve, reject) => {
authAPI
.login(credentials)
.then(() => {
.then(response => {
commit(types.default.SET_CURRENT_USER);
window.axios = createAxios(axios);
actionCable.init(Vue);
window.location = DEFAULT_REDIRECT_URL;
window.location = getLoginRedirectURL(ssoAccountId, response.data);
resolve();
})
.catch(error => {