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
import { takeLatest } from 'redux-saga/effects' | |
import { | |
CREATE_USER, | |
FETCH_USER, | |
} from 'src/store/definitions' | |
import { | |
createUserSaga, | |
fetchUserSaga, |
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
import { | |
SIGN_UP | |
} from '../keys' | |
export default { | |
[SIGN_UP]: 'Sign up', | |
} |
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
import auth from './auth' | |
export default { | |
...auth, | |
} |
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
import t, { | |
SIGN_UP | |
} from 'src/lang' | |
export default ({ handleSignUpClick }) => ( | |
<button onClick={handleSignUpClick}> | |
{t(SIGN_UP)} | |
</button> | |
) |
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
export const SIGN_UP = 'SIGN_UP' |
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
export * from './auth' |
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
import i18n from 'i18n-js' | |
import en from './locales/en' | |
import es from './locales/es' | |
import pt from './locales/pt' | |
i18n.translations = { | |
en, | |
es, | |
pt, |
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
import jwt | |
secret = 'minha_super_chave_imprevisivel' | |
meu_jwt = request['headers']['authorization'] | |
try: | |
informacoes = jwt.decode(meu_jwt, secret, algorithm='HS256') | |
except ExpiredSignatureError: | |
print('Seu token esta expirado!') |
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
import jwt | |
from time import time # para geracao da timestamp | |
secret = 'minha_super_chave_imprevisivel' | |
user_id = 123 | |
payload = { | |
'uid': user_id, | |
'exp': int(time()) + 3600 # queremos que o token seja valido por uma hora |
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
(function(d, s, id){ | |
var js, fjs = d.getElementsByTagName(s)[0] | |
if (d.getElementById(id)) {return} | |
js = d.createElement(s); js.id = id | |
js.src = "//connect.facebook.net/en_US/sdk.js" | |
fjs.parentNode.insertBefore(js, fjs) | |
}(document, 'script', 'facebook-jssdk')) | |
window.fbAsyncInit = function() { | |
FB.init({ |