Overrides allauth.account.views.signup
493732
def signup(request, **kwargs):
    
    if not ALLAUTH:
        return http.HttpResponse(_('allauth not installed...'))
    if request.method == "POST" and 'login' in request.POST:
        form_class = LoginForm
        form = form_class(request.POST)
        redirect_field_name = "next"
        success_url = get_default_redirect(request, redirect_field_name)
        if form.is_valid():
            return form.login(request, redirect_url=success_url)
    response = allauth_signup(request, **kwargs)
    return response
875877
def setup_for_bottle(
        auth, app, send_email=None, render=None,
        session=None, request=None, urloptions=None):
    import bottle

    auth.request = request or bottle.request
    if session is not None:
        auth.session = session
    if send_email:
        auth.send_email = send_email

    auth.render = render or bottle.template
    bottle.BaseTemplate.defaults['csrf_token'] = auth.get_csrf_token
    bottle.BaseTemplate.defaults['auth'] = auth

    

    @bottle.hook('before_request')
    def after_request():
        auth.session = session or getattr(bottle.request, 'session') \
            or bottle.request.environ.get('beaker.session')
        assert auth.session, 'Session not found'

        # By doing this, ``bottle.request`` now has a ``user`` attribute
        # that it's replaced by the real user object the first time is used.
        LazyUser(auth, bottle.request, user_name=auth.user_name)

    if auth.views:
        assert auth.render
        setup_for_bottle_views(auth, app, urloptions)
568849
def EMAIL_REQUIRED(self):
        
        from allauth.account import app_settings as account_settings
        return self._setting("EMAIL_REQUIRED", account_settings.EMAIL_REQUIRED)
697880
def eauth(self, adata, load):
        '''
        
        '''
        for sub_auth in [adata]:
            if load['eauth'] not in sub_auth:
                continue
            try:
                name = self.loadauth.load_name(load)
                if not ((name in sub_auth[load['eauth']]) |
                        ('*' in sub_auth[load['eauth']])):
                    continue
                if not self.loadauth.time_auth(load):
                    continue
            except Exception as exc:
                log.error('Exception occurred while authenticating: %s', exc)
                continue
            yield {'sub_auth': sub_auth, 'name': name}
        yield {}
956856
def register_views(self, app):
        
        self.add_resource(LoginRedirectView, '/auth/login')
        self.add_resource(LogoutRedirectView, '/auth/logout')

        for entry_point in CINQ_PLUGINS['cloud_inquisitor.plugins.auth']['plugins']:
            cls = entry_point.load()
            app.available_auth_systems[cls.name] = cls

            if app.register_auth_system(cls):
                for vcls in cls.views:
                    self.add_resource(vcls, *vcls.URLS)
                    logger.debug('Registered auth system view {} for paths: {}'.format(
                        cls.__name__,
                        ', '.join(vcls.URLS)
                    ))

        if not app.active_auth_system:
            logger.error('No auth systems active, please enable an auth system and then start the system again')
            sys.exit(-1)

        for entry_point in CINQ_PLUGINS['cloud_inquisitor.plugins.views']['plugins']:
            view = entry_point.load()
            self.add_resource(view, *view.URLS)
            app.register_menu_item(view.MENU_ITEMS)

            logger.debug('Registered view {} for paths: {}'.format(view.__name__, ', '.join(view.URLS)))
1252579
private void configureStateAuth() {
        setIsControlEnable(authButton, false);
        if(isAuthenticated()) {
            authStatusLabel.setText(I18nLabelsLoader.ADDON_LOGIN_STATUS_OK);
            setDefaultButton(nextButtonName, true);
            if(userPasswordText.getText() != null && userPasswordText.getText().length() == 0) {
                userPasswordText.setText("********");
            }            
            setDefaultButton(authButton, false);
            setDefaultButton(cancelButtonName, false);
            setDefaultButton(nextButtonName, true);
        } else if (gotCommunicationError) {
            // leave previous state
            setIsControlEnable(authButton, true);
            setDefaultButton(cancelButtonName, true);
        }
    }
275166
def put(self, accountId):
        """"""
        self.reqparse.add_argument('accountName', type=str, required=True)
        self.reqparse.add_argument('accountType', type=str, required=True)
        self.reqparse.add_argument('contacts', type=dict, required=True, action='append')
        self.reqparse.add_argument('enabled', type=int, required=True, choices=(0, 1))
        self.reqparse.add_argument('requiredRoles', type=str, action='append', default=())
        self.reqparse.add_argument('properties', type=dict, required=True)
        args = self.reqparse.parse_args()

        account_class = get_plugin_by_name(PLUGIN_NAMESPACES['accounts'], args['accountType'])
        if not account_class:
            raise InquisitorError('Invalid account type: {}'.format(args['accountType']))

        validate_contacts(args['contacts'])

        if not args['accountName'].strip():
            raise Exception('You must provide an account name')

        if not args['contacts']:
            raise Exception('You must provide at least one contact')

        class_properties = {from_camelcase(key): value for key, value in args['properties'].items()}
        for prop in account_class.class_properties:
            if prop['key'] not in class_properties:
                raise InquisitorError('Missing required property {}'.format(prop))

        account = account_class.get(accountId)
        if account.account_type != args['accountType']:
            raise InquisitorError('You cannot change the type of an account')

        account.account_name = args['accountName']
        account.contacts = args['contacts']
        account.enabled = args['enabled']
        account.required_roles = args['requiredRoles']
        account.update(**args['properties'])
        account.save()

        auditlog(event='account.update', actor=session['user'].username, data=args)

        return self.make_response({'message': 'Object updated', 'account': account.to_json(is_admin=True)})
807349
def whitelisted_params
      whitelist = params_for_resource(:sign_up)

      whitelist.inject({}) do |coll, key|
        param = omniauth_params[key.to_s]
        coll[key] = param if param
        coll
      end
    end
993959
def auth(self, value):
        
        self._auth = value
        self._request.auth = value
657681
def auth_view(name, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('auth:group:view', **{
        'storage': ctx.repo.create_secure_service('storage'),
        'name': name,
    })
1260717
def post(self):
        """"""
        self.reqparse.add_argument('accountName', type=str, required=True)
        self.reqparse.add_argument('accountType', type=str, required=True)
        self.reqparse.add_argument('contacts', type=dict, required=True, action='append')
        self.reqparse.add_argument('enabled', type=int, required=True, choices=(0, 1))
        self.reqparse.add_argument('requiredGroups', type=str, action='append', default=())
        self.reqparse.add_argument('properties', type=dict, required=True)
        args = self.reqparse.parse_args()

        account_class = get_plugin_by_name(PLUGIN_NAMESPACES['accounts'], args['accountType'])
        if not account_class:
            raise InquisitorError('Invalid account type: {}'.format(args['accountType']))

        validate_contacts(args['contacts'])

        for key in ('accountName', 'accountType', 'contacts', 'enabled'):
            value = args[key]
            if type(value) == str:
                value = value.strip()

            if type(value) in (int, tuple, list, str):
                if not value:
                    raise Exception('{} cannot be empty'.format(key.replace('_', ' ').title()))
            else:
                raise ValueError('Invalid type: {} for value {} for argument {}'.format(type(value), value, key))

        class_properties = {from_camelcase(key): value for key, value in args['properties'].items()}
        for prop in account_class.class_properties:
            if prop['key'] not in class_properties:
                raise InquisitorError('Missing required property {}'.format(prop))

        acct = account_class.create(
            account_name=args['accountName'],
            contacts=args['contacts'],
            enabled=args['enabled'],
            required_roles=args['requiredGroups'],
            properties=class_properties,
            auto_commit=False
        )
        db.session.commit()

        # Add the newly created account to the session so we can see it right away
        session['accounts'].append(acct.account_id)
        auditlog(event='account.create', actor=session['user'].username, data=args)

        return self.make_response({'message': 'Account created', 'accountId': acct.account_id}, HTTP.CREATED)
404315
function AuthenticationOAuth(options) {
    AuthenticationAbstract.call(this, options);
    options = options || {};
    this._token = {
        access: options.accessToken || null
    };
}
354920
def newaccount(ctx, accountname, account, password):
    
    pprint(
        ctx.peerplays.create_account(accountname, registrar=account, password=password)
    )
818834
def authenticate(self, request, **credentials):
        """"""
        from allauth.account.auth_backends import AuthenticationBackend

        self.pre_authenticate(request, **credentials)
        AuthenticationBackend.unstash_authenticated_user()
        user = authenticate(request, **credentials)
        alt_user = AuthenticationBackend.unstash_authenticated_user()
        user = user or alt_user
        if user and app_settings.LOGIN_ATTEMPTS_LIMIT:
            cache_key = self._get_login_attempts_cache_key(
                request, **credentials)
            cache.delete(cache_key)
        else:
            self.authentication_failed(request, **credentials)
        return user
5337
def register_view(self, view):
        
        super(StateOutcomesEditorController, self).register_view(view)
        if isinstance(view, StateOutcomesEditorView):
            self.connect_signal(view['add_button'], "clicked", self.oc_list_ctrl.on_add)
            self.connect_signal(view['remove_button'], "clicked", self.oc_list_ctrl.on_remove)

            if isinstance(self.model.state, LibraryState) or self.model.state.get_next_upper_library_root_state():
                view['add_button'].set_sensitive(False)
                view['remove_button'].set_sensitive(False)
1265471
def oauth_signup(self, provider, attrs, defaults, redirect_url=None):
        
        session["oauth_user_defaults"] = defaults
        session["oauth_user_attrs"] = dict(provider=provider, **attrs)
        if not redirect_url:
            redirect_url = request.args.get("next")
        return redirect(url_for('users.oauth_signup', next=redirect_url))
1220442
protected function overrideViews()
    {
        $dir = Str::snake($this->controllerName());
        $path = base_path('resources/views/admin/').$dir;
        app('view')->prependNamespace('decoy', $path);
    }