Skip to content
This repository was archived by the owner on Aug 2, 2024. It is now read-only.

Commit fe9ffe2

Browse files
committed
Better error handling
1 parent a5f13bf commit fe9ffe2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/CUMSA/Raven/Http/Controllers/RavenController.php

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ public function redirectToProvider() {
3232
*/
3333
public function handleProviderCallback() {
3434
$user = $this->raven->user();
35+
if (is_null($user)) {
36+
return redirect('/')->with('message', 'Login cancelled');
37+
}
3538

3639
$authUser = $this->findOrCreateUser($user);
3740
Auth::login($authUser, true);

src/CUMSA/Raven/RavenAuth.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ public function redirect() {
1818
public function user() {
1919
$ret = $this->webauth->callback();
2020
if (!$ret || !$this->webauth->success()) {
21-
throw new Exception('UCamWebAuth: ' . $this->webauth->status() . $this->webauth->msg());
21+
if (!in_array($this->webauth->status(), ['410'])) {
22+
throw new Exception('UCamWebAuth: ' . $this->webauth->status() . $this->webauth->msg());
23+
}
2224
} else {
2325
return new RavenUser($this->webauth->principal());
2426
}

0 commit comments

Comments
 (0)