import {API_SERVER_LOGIN} from '../config.js';

const MODULE = 'AUTH_';

export const LOGIN = MODULE + 'LOGIN';
export const LOGOUT = MODULE + 'LOGOUT';
export const LOGIN_SUCCESS = MODULE + 'LOGIN_SUCCESS';
export const LOGIN_FAIL = MODULE + 'LOGIN_FAIL';

export const REQUEST_FORGOT_PASSWORD = MODULE + 'REQUEST_FORGOT_PASSWORD';
export const FORGOT_PASSWORD = MODULE + 'FORGOT_PASSWORD';

export const VALIDATE_TOKEN = MODULE + 'VALIDATE_TOKEN';

export const REQUEST_MODULES = MODULE + 'REQUEST_MODULES';
export const RECIEVE_MODULES = MODULE + 'RECIEVE_MODULES';

export const REFRESH_TOKEN = MODULE + 'REFRESH_TOKEN';

export const REQUEST_CHANGE = MODULE + 'REQUEST_CHANGE';
export const PASSWORD_CHANGED = MODULE + 'PASSWORD_CHANGED';

export const SET_COMPANY_ADMIN_FLAG = MODULE + 'SET_COMPANY_ADMIN_FLAG';

export const authActivity = {
    lastActivity : Date.now()
};


export const loginMessages = {
    INVALID_USERNAME_PASSWORD: 'Invalid username or password',
    EXPIRED_TOKEN: 'Your session has expired',
    LOGGED_OUT: 'You have been successfully logged out !',
    NO_USER: 'Please review the mail address and try again!',
    GENERATED_SUCCESSFULLY: 'An email was sent to you. Please check your inbox to change your password',
    CHANGE_LATER: 'You can change your password in 5 minutes!',
    INVALID_REFRESH_TOKEN: 'Your session has expired!',
    EXPIRED_SESSION :  'Your session has expired!',
    INVALID_USER_TYPE: 'Users with other roles than "customer" must use this url for login: ' + API_SERVER_LOGIN,
    INVALID_CHANGE_TOKEN: 'Invalid change token value!',
    PASSWORDS_MISSING: 'Password can not be empty',
    WRONG_USERNAME: 'Invalid username!',
    PASSWORD_GENERATED: 'Password has been changed!',
    ERROR_PASSWORD_GENERATED: 'There seems to be a problem and the password was not saved!',
    PASSWORD_SAME: 'The password cannot be the same with the old password!',
    PASSWORD_MISMATCH: 'The new password and the confirmation password are not the same!',
    PASSWORD_INCORRECT: 'The password must contain at least one lower case letter, one uppercaser letter, one number and one special character!',
    FORGOT_REQUEST_SENT: 'Sending request...'
}

export const loginTexts = {
    labels: {
        CHANGE_PASSWORD: 'Change Password',
        NEW_PASSWORD: 'New password',
        CONFIRM_PASSWORD: 'Confirm password',
        WELCOME_TO: 'Welcome to',
        SIGN_IN: 'Sign In',
        USERNAME: 'Username',
        PASSWORD: 'Password',

    },
    buttons: {
        CHANGE_PASSWORD: 'Change Password',
        SIGN_IN: 'Sign In',
        BACK_TO_SIGNIN: 'Back to Sign In',
        FORGOT_PASSWORD: 'Forgot password?'
    }
};
