Package models

Examples of models.Token


            flash("error", Messages.get("error.technical"));
            Form<AskForm> askForm = form(AskForm.class);
            return badRequest(ask.render(askForm));
        }

        Token resetToken = Token.findByTokenAndType(token, Token.TypeToken.password);
        if (resetToken == null) {
            flash("error", Messages.get("error.technical"));
            Form<AskForm> askForm = form(AskForm.class);
            return badRequest(ask.render(askForm));
        }

        if (resetToken.isExpired()) {
            resetToken.delete();
            flash("error", Messages.get("error.expiredresetlink"));
            Form<AskForm> askForm = form(AskForm.class);
            return badRequest(ask.render(askForm));
        }
View Full Code Here


            flash("error", Messages.get("signup.valid.password"));
            return badRequest(reset.render(resetForm, token));
        }

        try {
            Token resetToken = Token.findByTokenAndType(token, Token.TypeToken.password);
            if (resetToken == null) {
                flash("error", Messages.get("error.technical"));
                return badRequest(reset.render(resetForm, token));
            }

            if (resetToken.isExpired()) {
                resetToken.delete();
                flash("error", Messages.get("error.expiredresetlink"));
                return badRequest(reset.render(resetForm, token));
            }

            // check email
View Full Code Here

        if (token == null) {
            flash("error", Messages.get("error.technical"));
            return badRequest(emailValidate.render(user));
        }

        Token resetToken = Token.findByTokenAndType(token, Token.TypeToken.email);
        if (resetToken == null) {
            flash("error", Messages.get("error.technical"));
            return badRequest(emailValidate.render(user));
        }

        if (resetToken.isExpired()) {
            resetToken.delete();
            flash("error", Messages.get("error.expiredmaillink"));
            return badRequest(emailValidate.render(user));
        }

        user.email = resetToken.email;
View Full Code Here

            User existentUser = User.findByEmail(registration.email);
            if (existentUser != null) {
                Token.sendMailResetPassword(existentUser);
            } else {
                User user = User.create(registration.email, registration.password);
                Token confirmationToken = Token.createConfirmationToken(user);
                sendConfirmationMail(confirmationToken);
            }
            return ok(views.html.account.registrationSuccess.render(registrationForm));
        }
    }
View Full Code Here

            type = Token.Type.fromUrlPath(tokenTypeString);
        } catch (IllegalArgumentException e) {
            log.error("unknown token type [{}]", tokenTypeString);
            return badRequest("");
        }
        Token token = Token.findByTokenAndType(tokenString, type);
        if (token == null) {
            return redirect("/");
        } else {
            User user = User.finder.byId(token.userId);
            if (user == null) {
View Full Code Here

TOP

Related Classes of models.Token

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.