Commit ba933100 authored by David Burke's avatar David Burke

Nativescript environment

parent abf805f0
Pipeline #20160143 failed with stage
in 6 minutes and 23 seconds
......@@ -35,9 +35,6 @@ export class LoginEffects {
.withLatestFrom(this.store.select(fromAccount.getLoginForm))
.map(([action, form]) => form.value)
.exhaustMap(auth => {
if (IS_EXTENSION) {
auth.rememberMe = true;
}
const promises: Array<Promise<any>> = [];
if (auth.url) {
promises.push(this.userService.checkAndSetUrl(auth.url));
......
......@@ -3,20 +3,23 @@ import {
createFormGroupState,
formGroupReducer,
validate,
updateGroup
updateGroup,
markAsSubmitted
} from "ngrx-forms";
import { required, minLength, pattern } from "ngrx-forms/validation";
import { environment } from "../../../environments/environment";
import { AccountActions, AccountActionTypes } from "../account.actions";
import { ILoginForm } from ".";
import { DEFAULT_API } from "../../constants";
const FORM_ID = "Login Form";
const initialFormState = createFormGroupState<ILoginForm>(FORM_ID, {
email: "",
password: "",
rememberMe: false,
url: ""
rememberMe: environment.extension || environment.nativescript ? true : false,
url: environment.extension || environment.nativescript ? DEFAULT_API : ""
});
export interface ILoginState {
......@@ -51,6 +54,7 @@ export function reducer(
case AccountActionTypes.LOGIN:
return {
...state,
form: markAsSubmitted(state.form),
hasStarted: true,
hasFinished: false,
errorMessage: null
......
......@@ -27,3 +27,4 @@ if (environment.docker && window.location.hostname === "web") {
}
export const IS_EXTENSION = environment.extension;
export const DEFAULT_API = "app.passit.io";
export const environment = {
production: false,
extension: false,
docker: true
docker: true,
nativescript: false,
};
export const environment = {
production: true,
extension: true,
docker: false
docker: false,
nativescript: false,
};
export const environment = {
production: true,
extension: false,
docker: false
docker: false,
nativescript: false,
};
......@@ -6,5 +6,6 @@
export const environment = {
production: false,
extension: false,
docker: false
docker: false,
nativescript: false,
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment