def _process_args(self): self.identity_info = load_identity_info() if not self.identity_info or self.identity_info['indico_user_id'] is None: # Just redirect to the front page or whereever we wanted to go. # Probably someone simply used his browser's back button. flash('There is no pending login.', 'warning') return multipass.redirect_success() self.user = User.get(self.identity_info['indico_user_id']) self.emails = sorted(self.user.all_emails & set(self.identity_info['data'].getlist('email'))) self.verification_email_sent = self.identity_info.get('verification_email_sent', False) self.email_verified = self.identity_info['email_verified'] self.must_choose_email = len(self.emails) != 1 and not self.email_verified
def _checkParams(self): self.identity_info = None self.provider_name = request.view_args['provider'] if self.provider_name is not None: self.identity_info = info = load_identity_info() if not info: return redirect(url_for('.login')) elif info['indico_user_id'] is not None or info['provider'] != self.provider_name: # If we have a matching user id, we shouldn't be on the registration page # If the provider doesn't match it would't be a big deal but the request doesn't make sense raise BadRequest elif not Config.getInstance().getLocalIdentities(): raise Forbidden('Local identities are disabled')
def _process_args(self): self.identity_info = None self.provider_name = request.view_args['provider'] if self.provider_name is not None: self.identity_info = info = load_identity_info() if not info: return redirect(url_for('.login')) elif info['indico_user_id'] is not None or info['provider'] != self.provider_name: # If we have a matching user id, we shouldn't be on the registration page # If the provider doesn't match it would't be a big deal but the request doesn't make sense raise BadRequest elif not config.LOCAL_IDENTITIES: raise Forbidden('Local identities are disabled') elif not config.LOCAL_REGISTRATION: raise Forbidden('Local registration is disabled')