Skip to content

Commit

Permalink
removing logout changes
Browse files Browse the repository at this point in the history
  • Loading branch information
namansleeps committed Oct 10, 2023
1 parent 3d73a47 commit 5c4ab49
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions gui/pages/Dashboard/TopBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export default function TopBar({selectedProject, userName, env}) {
return;
}
getUserClick('Logged Out',{})
// localStorage.removeItem('accessToken');
Cookies.set('accessToken', '', { expires: new Date(0)});
localStorage.removeItem('accessToken');
Cookies.set('accessToken', '', { expires: new Date(0), domain: '.superagi.com', path: '/' });
refreshUrl();
router.reload();
};
Expand Down
7 changes: 2 additions & 5 deletions gui/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,7 @@ export default function App() {
const singupCampaign = sessionStorage.getItem('campaign');

if (typeof window !== 'undefined' && access_token) {
// localStorage.setItem('accessToken', access_token);
console.log(access_token+'///')
Cookies.set('accessToken', access_token);
console.log(Cookies.get('accessToken')+'khikhikhhi')
localStorage.setItem('accessToken', access_token);
refreshUrl();
}
validateAccessToken()
Expand All @@ -155,7 +152,7 @@ export default function App() {
if(signupSource) {
handleSignUpSource(signupSource)
}
// Cookies.set('accessToken', localStorage.getItem('accessToken'),{ domain: '.superagi.com', path: '/' });
Cookies.set('accessToken', localStorage.getItem('accessToken'),{ domain: '.superagi.com', path: '/' });
fetchOrganisation(response.data.id);
})
.catch((error) => {
Expand Down
6 changes: 2 additions & 4 deletions gui/pages/api/apiConfig.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import axios from 'axios';
import Cookies from "js-cookie";

const GITHUB_CLIENT_ID = process.env.GITHUB_CLIENT_ID || 'eaaf029abe1165e23c1e';
const GITHUB_CLIENT_ID = process.env.GITHUB_CLIENT_ID;
const API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:8001';
const GOOGLE_ANALYTICS_MEASUREMENT_ID = process.env.GOOGLE_ANALYTICS_MEASUREMENT_ID;
const GOOGLE_ANALYTICS_API_SECRET = process.env.GOOGLE_ANALYTICS_API_SECRET;
Expand Down Expand Up @@ -38,8 +37,7 @@ const api = axios.create({

api.interceptors.request.use(config => {
if (typeof window !== 'undefined') {
const accessToken = Cookies.get("accessToken");
console.log(accessToken +'hahahahahah')
const accessToken = localStorage.getItem("accessToken");
if (accessToken) {
config.headers['Authorization'] = `Bearer ${accessToken}`;
}
Expand Down
1 change: 0 additions & 1 deletion gui/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {EventBus} from "@/utils/eventBus";
import JSZip from "jszip";
import moment from 'moment';
import mixpanel from 'mixpanel-browser'
import Cookies from "js-cookie";

const toolkitData = {
'Jira Toolkit': '/images/jira_icon.svg',
Expand Down

0 comments on commit 5c4ab49

Please sign in to comment.