Package models

Examples of models.User.save()


        user.email = "fakeuser@fake.com";
        user.name = "racoon";
        user.password = "somefakepassword";
        user.createdDate = JodaDateUtil.now();
        user.state = UserState.LOCKED;
        user.save();

        Map<String, String> data = new HashMap<>();
        data.put("loginIdOrEmail", user.loginId);
        data.put("password", user.password);
View Full Code Here


            User user = User.findByEmail("thorben@stangenberg.net");
            if (user == null) {
                user = User.create("thorben@stangenberg.net", "a");
            }
            user.validated = true;
            user.save();
        } catch (AppException e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }
View Full Code Here

            User user = User.finder.byId(token.userId);
            if (user == null) {
                return badRequest("");
            } else {
                user.validated = true;
                user.save();
                return ok();
            }
        }
    }
View Full Code Here

        if (type == AccountType.DROPBOX) {
            user.setSecret("somesecret");
        } else if (type == AccountType.BOX) {
            user.email = "e@mail.com";
        }
        user.save();
        return user;
    }

    public static User createUser(User user) throws Exception {
        user.save();
View Full Code Here

            // We got the verifier; now get the access token, store it and back to index
            OAuth.Response oauthResponse = OAuth.service(TWITTER).retrieveAccessToken(user.token, user.secret);
            if (oauthResponse.error == null) {
                user.token = oauthResponse.token;
                user.secret = oauthResponse.secret;
                user.save();
            } else {
                Logger.error("Error connecting to twitter: " + oauthResponse.error);
            }
            index();
        }
View Full Code Here

        OAuth.Response oauthResponse = twitt.retrieveRequestToken();
        if (oauthResponse.error == null) {
            // We received the unauthorized tokens in the OAuth object - store it before we proceed
            user.token = oauthResponse.token;
            user.secret = oauthResponse.secret;
            user.save();
            redirect(twitt.redirectUrl(oauthResponse.token));
        } else {
            Logger.error("Error connecting to twitter: " + oauthResponse.error);
            index();
        }
View Full Code Here

    public static void auth() {
        if (OAuth2.isCodeResponse()) {
            User u = connected();
            OAuth2.Response response = FACEBOOK.retrieveAccessToken(authURL());
            u.access_token = response.accessToken;
            u.save();
            index();
        }
        FACEBOOK.retrieveVerificationCode(authURL());
    }
View Full Code Here

    public static void auth() {
        if (OAuth2.isCodeResponse()) {
            User u = connected();
            OAuth2.Response response = FACEBOOK.retrieveAccessToken(authURL());
            u.access_token = response.accessToken;
            u.save();
            index();
        }
        FACEBOOK.retrieveVerificationCode(authURL());
    }
View Full Code Here

            // We got the verifier; now get the access token, store it and back to index
            OAuth.Response oauthResponse = OAuth.service(TWITTER).retrieveAccessToken(user.token, user.secret);
            if (oauthResponse.error == null) {
                user.token = oauthResponse.token;
                user.secret = oauthResponse.secret;
                user.save();
            } else {
                Logger.error("Error connecting to twitter: " + oauthResponse.error);
            }
            index();
        }
View Full Code Here

        OAuth.Response oauthResponse = twitt.retrieveRequestToken();
        if (oauthResponse.error == null) {
            // We received the unauthorized tokens in the OAuth object - store it before we proceed
            user.token = oauthResponse.token;
            user.secret = oauthResponse.secret;
            user.save();
            redirect(twitt.redirectUrl(oauthResponse.token));
        } else {
            Logger.error("Error connecting to twitter: " + oauthResponse.error);
            index();
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.