feat: Support dark mode in login pages (#7420)

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
This commit is contained in:
Pranav Raj S
2023-06-30 19:19:52 -07:00
committed by GitHub
parent 022f4f899f
commit b57063a8b8
57 changed files with 1516 additions and 1483 deletions

View File

@@ -2,12 +2,7 @@ import Vue from 'vue';
import types from '../mutation-types';
import authAPI from '../../api/auth';
import {
setUser,
clearCookiesOnLogout,
clearLocalStorageOnLogout,
} from '../utils/api';
import { getLoginRedirectURL } from '../../helper/URLHelper';
import { setUser, clearCookiesOnLogout } from '../utils/api';
const initialState = {
currentUser: {
@@ -97,24 +92,6 @@ export const getters = {
// actions
export const actions = {
login(_, { ssoAccountId, ssoConversationId, ...credentials }) {
return new Promise((resolve, reject) => {
authAPI
.login(credentials)
.then(response => {
clearLocalStorageOnLogout();
window.location = getLoginRedirectURL({
ssoAccountId,
ssoConversationId,
user: response.data,
});
resolve();
})
.catch(error => {
reject(error);
});
});
},
async validityCheck(context) {
try {
const response = await authAPI.validityCheck();

View File

@@ -67,6 +67,9 @@ export const parseAPIErrorResponse = error => {
if (error?.response?.data?.error) {
return error?.response?.data?.error;
}
if (error?.response?.data?.errors) {
return error?.response?.data?.errors[0];
}
return error;
};