Esempio n. 1
0
    def post(self):
        email = self.data['email']
        password = self.data['password']
        user = User.auth_with_password(email, password)
        expires = not self.data['remember']

        if user:
            return {
                'token': create_token(user, expires=expires),
            }
        else:
            raise APIError({'msg': 'invalid_password'})
Esempio n. 2
0
    def post(self):
        email = self.data['email']
        password = self.data['password']
        user = User.auth_with_password(email, password)
        expires = not self.data['remember']

        if user:
            return {
                'token': gen_token(user, expires=expires),
                'settings': user.settings,
            }
        else:
            raise PyError({'msg': 'invalid_password'})
Esempio n. 3
0
File: api.py Progetto: kgov1/pytaku
    def post(self):
        email = self.data['email']
        password = self.data['password']
        user = User.auth_with_password(email, password)
        expires = not self.data['remember']

        if user:
            return {
                'token': gen_token(user, expires=expires),
                'settings': user.settings,
            }
        else:
            raise PyError({'msg': 'invalid_password'})