Skip to content
This repository has been archived by the owner on Sep 25, 2018. It is now read-only.

Commit

Permalink
Enable user sessions, delete auth0 tokens (#2343)
Browse files Browse the repository at this point in the history
* [xdl] remove auth0 everywhere

* [xdl] enable sessions

* [www] remove xdl test helper on www

* [xdl] fixed tests

* [xdl/xde] pr feedback

fbshipit-source-id: 164bbcc
  • Loading branch information
quinlanj authored and expbot committed Apr 15, 2018
1 parent 3efcddd commit a5ae8fe
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
20 changes: 1 addition & 19 deletions src/state/reducers/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ export const actions = {
asyncAction(
'CHECK_SESSION',
async () => {
// migrate from auth0 to sessions, if available
await UserManager.migrateAuth0ToSessionAsync();

const user = await UserManager.getCurrentUserAsync();
if (!user) {
throw new Error('');
Expand All @@ -45,9 +42,6 @@ export const actions = {
asyncAction(
'LOGIN',
async () => {
// migrate from auth0 to sessions, if available
await UserManager.migrateAuth0ToSessionAsync();

const currentWindow = remote.getCurrentWindow();
try {
const user = await UserManager.loginAsync(loginType, loginArgs);
Expand All @@ -70,9 +64,6 @@ export const actions = {

forgotPassword: (usernameOrEmail: string) =>
asyncAction('FORGOT_PASSWORD', async () => {
// migrate from auth0 to sessions, if available
await UserManager.migrateAuth0ToSessionAsync();

let result = await UserManager.forgotPasswordAsync(usernameOrEmail);

if (result) {
Expand All @@ -87,9 +78,6 @@ export const actions = {
asyncAction(
'REGISTER',
async (dispatch: AppDispatch, getState: () => AppState) => {
// migrate from auth0 to sessions, if available
await UserManager.migrateAuth0ToSessionAsync();

const state = getState();
const user = await UserManager.registerAsync(userData, state.auth.user);
return {
Expand All @@ -110,8 +98,6 @@ type State = {
pendingAction: ?ActionTypes,
error: ?string,
authenticated: boolean,
accessToken: ?string,
idToken: ?string, // jwt
user: ?UserOrLegacyUser,
};

Expand All @@ -120,8 +106,6 @@ const initialState: State = {
pendingAction: null,
error: null,
authenticated: false,
accessToken: null,
idToken: null,
user: null,
};

Expand Down Expand Up @@ -149,9 +133,7 @@ function authComplete(state: State, action: LoginAction): State {
...state,
pendingAction: null,
error: null,
authenticated: !!user.accessToken || !!user.sessionSecret,
accessToken: user.accessToken || null,
idToken: user.idToken || null,
authenticated: !!user.sessionSecret,
user,
};
}
Expand Down
3 changes: 0 additions & 3 deletions src/ui/MainScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -663,9 +663,6 @@ class MainScreen extends React.Component {

this._logInfo('Publishing...');
try {
// migrate from auth0 to sessions, if available
await UserManager.migrateAuth0ToSessionAsync();

let result = await Project.publishAsync(this.state.projectRoot);
await new Promise(resolve => {
requestAnimationFrame(resolve);
Expand Down

0 comments on commit a5ae8fe

Please sign in to comment.