text: import { Linking } from 'react-native'
  import { CookieManager } from '@startupjs/auth'
  import moment from 'moment'
  import { BASE_URL } from '@env'
  import { LOGIN_URL } from '../../isomorphic'
  
  export default async function onLogin ({
    baseUrl = BASE_URL,
    redirectUrl,
    expiresRedirectUrl
  }) {
    // set redirectUrl in cookie and play redirect from server
    if (redirectUrl) {
      CookieManager.set({
        baseUrl,
        name: 'authRedirectUrl',
        value: redirectUrl,
        expires: moment().add(expiresRedirectUrl, 'milliseconds')
      })
    }
  
    Linking.openURL(LOGIN_URL)
  }
  