Blih Class
@constructor
@param  {string} email Login
@param  {string} password Unix password
767849
function Blih(email, password)
{
  this.data = {
    baseUrl: 'https://blih.epitech.eu/',
  }

  this.userData = {
    login: email,
    password: password,
    token: this.generateToken(password)
  }
}
837207
public static SignInResponse signIn(String email, String password){
        return signIn(new LoginCredentials(email,password));
    }
381406
function(server, model, options, logger) {
          const Log = logger.bind('Password Update')
          let Boom = require('boom')

          let collectionName = model.collectionDisplayName || model.modelName

          Log.note('Generating Password Update endpoint for ' + collectionName)

          let handler = async function(request, h) {
            try {
              let hashedPassword = model.generatePasswordHash(
                request.payload.password
              )

              await model.findByIdAndUpdate(request.params._id, {
                password: hashedPassword
              })

              return h.response('Password updated.').code(200)
            } catch (err) {
              Log.error(err)
              throw Boom.badImplementation(err)
            }
          }

          server.route({
            method: 'PUT',
            path: '/user/{_id}/password',
            config: {
              handler: handler,
              auth: null,
              description: "Update a user's password.",
              tags: ['api', 'User', 'Password'],
              validate: {
                params: {
                  _id: RestHapi.joiHelper.joiObjectId().required()
                },
                payload: {
                  password: Joi.string()
                    .required()
                    .description("The user's new password")
                }
              },
              plugins: {
                'hapi-swagger': {
                  responseMessages: [
                    { code: 200, message: 'Success' },
                    { code: 400, message: 'Bad Request' },
                    { code: 404, message: 'Not Found' },
                    { code: 500, message: 'Internal Server Error' }
                  ]
                }
              }
            }
          })
        }
213185
async def login(self, email: str, password: str) -> bool:
        """"""
        login_resp = await self._request(
            'post',
            API_URL_USER,
            json={
                'version': '1.0',
                'method': 'Signin',
                'param': {
                    'Email': email,
                    'Password': password,
                    'CaptchaCode': ''
                },
                'sourcetype': 0
            })

        _LOGGER.debug('Login response: %s', login_resp)

        if login_resp.get('Code') != 0:
            return False

        self.account_id = login_resp['Json']['gid']

        return True
581423
def login(cls, email, password):
        
        try:
            doc = yield cls.view.first(key=email, include_docs=True)
        except couch.NotFound:
            raise exceptions.Unauthorized('Unknown email address')

        user = cls(**doc['doc'])

        verified = user.verify_password(password)
        if not verified:
            raise exceptions.Unauthorized('Invalid password')

        token = yield Token.create(user)
        raise Return((user, token.id))
1340630
def reset_password
    email = params[:session] && params[:session][:email]
    credential = Credentials::Email.with email

    if user = (credential && credential.user)
      token = Tokens::PasswordReset.random_for user
      email = ::SessionMailer.reset_password_email(email, token, root_url)
      # TODO(pwnall): fix the serialization errors blocking deliver_later
      email.deliver_now
    end

    respond_to do |format|
      if user
        format.html do
          redirect_to new_session_url, alert:
              'Please check your e-mail for instructions'
        end
        format.json { render json: { } }
      else
        error_text = 'Invalid e-mail'
        format.html do
          redirect_to new_session_url, alert: error_text
        end
        format.json do
          render json: { error: :not_found, text: notice }
        end
      end
    end
  end
753270
function mail() {
  var awsURL = !!CONFIG && !!CONFIG.aws && !!CONFIG.aws.url ? CONFIG.aws.url : false;

  if (EMAIL) {
    CONFIG.mail.to = [EMAIL];
  }

  return gulp.src('dist/**/*.html')
    .pipe($.if(!!awsURL, $.replace(/=('|")(\/?assets\/img)/g, "=$1"+ awsURL)))
    .pipe($.mail(CONFIG.mail))
    .pipe(gulp.dest('dist'));
}
1327172
function onSignInWithEmailLink() {
  var email = $('#sign-in-with-email-link-email').val();
  var link = $('#sign-in-with-email-link-link').val() || undefined;
  if (auth.isSignInWithEmailLink(link)) {
    auth.signInWithEmailLink(email, link).then(onAuthSuccess, onAuthError);
  } else {
    alertError('Sign in link is invalid');
  }
}
1267151
function(data) {
      var headers = {
        email: data.email,
        password: data.password,
      };

      var url = 'enrollments/' + data.enrollment;


      return client.request('DELETE', url, headers);
    }
1314980
function ElasticSearch () {
  var self = this;

  self.klass = ElasticSearch;
  self.klass.super_.apply(self, arguments);

  var auth = [
        self.options.server.username,
        self.options.server.password
      ].compact().join(':');

  self.options.server.auth = auth;
  self.options.server.protocol = undefined;
}
203554
function login( usr, pwd ) {
    if ( typeof usr === 'undefined' ) usr = config.usr || '';
    if ( typeof pwd === 'undefined' ) pwd = config.pwd || '';

    return new Promise(
        function( resolve, reject ) {
            if ( typeof usr === 'undefined' ) {
                var autologin = Storage.local.get( "nigolotua" );
                if ( !Array.isArray( autologin ) ) return reject( {
                    id: exports.MISSING_AUTOLOGIN
                } );
                usr = autologin[ 0 ] || '';
                pwd = autologin[ 1 ] || '';
            }
            Storage.local.set( "nigolotua", null );
            svc( "tfw.login.Challenge", usr )
                .then(
                    function( code ) {
                        // Hashage du mot de passe à l'aide du code.
                        var output = [
                                0, 0, 0, 0,
                                0, 0, 0, 0,
                                0, 0, 0, 0,
                                0, 0, 0, 0
                            ],
                            i, j = 0,
                            pass = [],
                            k1, k2, k3;
                        for ( i = 0; i < pwd.length; i++ ) {
                            pass.push( pwd.charCodeAt( i ) );
                        }
                        if ( 256 % pass.length == 0 ) {
                            pass.push( 0 );
                        }

                        for ( i = 0; i < 256; i++ ) {
                            output[ i % 16 ] ^= i + pass[ i % pass.length ];
                            k1 = code[ j++ % code.length ] % 16;
                            k2 = code[ j++ % code.length ] % 16;
                            k3 = code[ j++ % code.length ] % 16;
                            output[ k3 ] ^= ( output[ k3 ] + 16 * k2 + k3 ) % 256;
                            output[ k2 ] ^= ( output[ k1 ] + output[ k3 ] ) % 256;
                        }
                        return svc( "tfw.login.Response", output );
                    },
                    reject
                )
                .then(
                    function( user ) {
                        if ( typeof user === 'object' ) {
                            currentUser = {
                                data: user,
                                hasRole: function( role ) {
                                    for ( var i = 0; i < user.roles.length; i++ ) {
                                        var item = user.roles[ i ];
                                        if ( item == role ) return true;
                                    }
                                    return false;
                                }
                            };
                            Storage.local.set( "nigolotua", [ usr, pwd ] );
                            exports.eventChange.fire();
                            resolve( user );
                        } else {
                            currentUser = null;
                            reject( {
                                id: exports.UNKNOWN_USER,
                                err: "Unknown user '" + usr + "'!"
                            } );
                        }
                    },
                    reject
                );
        }
    );
}
454588
function emailCheck(email, key) {
  email = email.toLowerCase();
  // escape email before using in regular expression
  const emailEsc = email.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
  const emailRegex = new RegExp('<' + emailEsc + '>');
  const userIds = key.getUserIds();
  for (let i = 0; i < userIds.length; i++) {
    const userId = userIds[i].toLowerCase();
    if (email === userId || emailRegex.test(userId)) {
      return true;
    }
  }
  return false;
}
67335
function sendPasswordResetEmail() {

  return application.sendPasswordResetEmail(accountEmail, function(err, token) {
    if (err) throw err;

    console.log("Sent email that included a link with password reset token: " + token.toString());
    console.log("If you like, go to mailinator.com and use this email address to view the email: " + accountEmail);

    //ok, moving on with the quickstart:
    return createGroup();
  });
}
407085
function (form) {
            var data = {
              email: form.data.email
            };

            if (req.organization) {
              data.accountStore = {
                href: req.organization.href
              };
            }

            application.sendPasswordResetEmail(data, function (err) {
              if (err) {
                logger.info('A user tried to reset their password, but supplied an invalid email address: ' + form.data.email + '.');
              }

              res.redirect(config.web.forgotPassword.nextUri);
            });
          }
693017
public static Observable<BackendUser> signInInBackground(String email, String password){
        return getAM().loginASync(new LoginCredentials(email, password));
    }
1333655
def login(self, email=None, password=None):
        """"""
        auth_url = self.url('auth')
        email = email or self._config.get('email')
        password = password or self._config.get('password')
        if password and not email:
            raise Exception('Email must be provided when password is.')
        while True:
            if not email:
                sys.stdout.write('Email: ')
                sys.stdout.flush()
                email = sys.stdin.readline().strip()
                if not email:
                    print('Goodbye!')
                    sys.exit(1)
            if not password:
                password = getpass.getpass('Password for {0}: '.format(email))
            response = self.request(auth_url, 'PUT', email=email,
                                    password=password)
            if response.status_code == 201:
                print('logged in as {0}'.format(email))
                self.save_prompt(email, password)
                self.email = email
                break
            else:
                print(response.json()['messages'])
                email = password = None
807188
function checkemail(next) {
      if (user.email) {
        userent.load$({ email: user.email }, function(err, userfound) {
          if (err) return done(err, { ok: false, user: user })
          if (userfound)
            return done(null, {
              ok: false,
              why: 'email-exists',
              nick: args.nick
            })
          next()
        })
        return
      }
      next()
    }