@@ -127,38 +127,36 @@ abstract class OAuth1Provider(
127
127
// this is the 1st step in the auth flow. We need to get the request tokens
128
128
val callbackUrl = routesService.authenticationUrl(id)
129
129
logger.debug(" [securesocial] callback url = " + callbackUrl)
130
- client.retrieveRequestToken(callbackUrl).flatMap {
131
- case accessToken =>
132
- val cacheKey = UUID .randomUUID().toString
133
- val redirect = Redirect (client.redirectUrl(accessToken.token)).withSession(request.session +
134
- (OAuth1Provider .CacheKey -> cacheKey))
135
- // set the cache key timeoutfor 5 minutes, plenty of time to log in
136
- cacheService.set(cacheKey, accessToken, 300 ).map {
137
- u =>
138
- AuthenticationResult .NavigationFlow (redirect)
139
- }
130
+ client.retrieveRequestToken(callbackUrl).flatMap { accessToken =>
131
+ val cacheKey = UUID .randomUUID().toString
132
+ val redirect = Redirect (client.redirectUrl(accessToken.token))
133
+ .withSession(request.session + (OAuth1Provider .CacheKey -> cacheKey))
134
+ // set the cache key timeoutfor 5 minutes, plenty of time to log in
135
+ cacheService
136
+ .set(cacheKey, accessToken, 300 )
137
+ .map(_ => AuthenticationResult .NavigationFlow (redirect))
140
138
} recover {
141
139
case e =>
142
140
logger.error(" [securesocial] error retrieving request token" , e)
143
- throw new AuthenticationException ()
141
+ throw AuthenticationException ()
144
142
}
145
143
} else {
146
144
// 2nd step in the oauth flow
147
145
val cacheKey = request.session.get(OAuth1Provider .CacheKey ).getOrElse {
148
146
logger.error(" [securesocial] missing cache key in session during OAuth1 flow" )
149
- throw new AuthenticationException ()
147
+ throw AuthenticationException ()
150
148
}
151
149
for (
152
150
requestToken <- cacheService.getAs[RequestToken ](cacheKey).recover {
153
151
case e =>
154
152
logger.error(" [securesocial] error retrieving entry from cache" , e)
155
- throw new AuthenticationException ()
153
+ throw AuthenticationException ()
156
154
};
157
155
accessToken <- client.retrieveOAuth1Info(
158
156
RequestToken (requestToken.get.token, requestToken.get.secret), verifier.get).recover {
159
157
case e =>
160
158
logger.error(" [securesocial] error retrieving access token" , e)
161
- throw new AuthenticationException ()
159
+ throw AuthenticationException ()
162
160
};
163
161
result <- fillProfile(accessToken)
164
162
) yield {
0 commit comments