Created
April 10, 2016 22:04
-
-
Save mykhas/a55c83b42218e3e079ee0ae5d36cd2e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* React Starter Kit (https://www.reactstarterkit.com/) | |
* | |
* Copyright © 2014-2016 Kriasoft, LLC. All rights reserved. | |
* | |
* This source code is licensed under the MIT license found in the | |
* LICENSE.txt file in the root directory of this source tree. | |
*/ | |
import React from 'react'; | |
import Login from './Login'; | |
import fetch from '../../core/fetch'; | |
export const path = '/login'; | |
export const action = async (state) => { | |
const response = await fetch('/graphql?query={me{id,email}}', { | |
credentials: 'same-origin', | |
}); | |
const { data } = await response.json(); | |
const title = 'Log In'; | |
state.context.onSetTitle(title); | |
return <Login title={title} me={data.me} />; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment