Exemplo n.º 1
0
 def get(self):
     if not login_using_local():
         return self.error(404)
     continue_to = self.request.get('continue_to', '')
     google_login_url = users.create_login_url(continue_to)
     using_google = login_using_google()
     return self.render('signin.html', locals())
Exemplo n.º 2
0
 def post(self):
     if not login_using_local():
         return self.error(404)
     email = self.request.get('email')
     password = self.request.get('password')
     errors = []
     try:
         self.validate(email, password)
         logging.info('validated')
         user = create_user(email, password)
         logging.info('created user')
         self.authenticate(user, password)
         logging.info('authed')
         return self.redirect('/profile/edit')
     except Exception, e:
         logging.error('Error %s' % e)
         errors.append(str(e))
Exemplo n.º 3
0
 def post(self):
     if not login_using_local():
         return self.error(404)
     email = self.request.get('email')
     password = self.request.get('password')
     continue_to = self.request.get('continue_to', '/')
     
     google_login_url = users.create_login_url(continue_to)
     errors = []
     local_user = UserAuth.gql('WHERE email=:1', email).get()
     if local_user and self.authenticate(local_user, password):
         login_user = local_user.get_user()
         profile = Profile.gql('WHERE user = :1', login_user).get()
         if not profile:
             created, profile = Profile.get_or_create_from_user(login_user)
             if created:
                 self.redirect('/profile/edit')
         return self.redirect(continue_to)
     else:
         errors.append('Login error, please relogin again')
     using_google = login_using_google()
     return self.render('signin.html', locals())
Exemplo n.º 4
0
 def get(self):
     if not login_using_local():
         return self.error(404)
     return self.render('signup.html', locals())