Skip to content

Instantly share code, notes, and snippets.

View CorneilleEdi's full-sized avatar
🌟
Solving problems

Ayao Corneille ALLOGBALO CorneilleEdi

🌟
Solving problems
View GitHub Profile
@CorneilleEdi
CorneilleEdi / gcrgc.sh
Created October 7, 2021 08:15 — forked from ahmetb/gcrgc.sh
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@CorneilleEdi
CorneilleEdi / api.js
Created March 18, 2020 05:11
JWT authentication handler using Axios interceptors. It refreshes access token on the fly when backend API throws out a 401 error. Multiple requests at the same time supported.
import axios from 'axios';
import JWTDecode from 'jwt-decode';
import { AuthApi } from './auth.api';
import { config } from '../config';
const { API_ENDPOINT } = config[process.env.NODE_ENV];
axios.defaults.baseURL = API_ENDPOINT;
axios.defaults.timeout = 7000;