github.com/shurcooL/notificationsapp/...

Handle error when no authed user tries to access NC. github.com/shurcooL/notificationsapp#2

Fixeddmitshur opened this issue 10 years ago
dmitshur commented 10 years ago

Notification Center app requires an authenticated user. Currently, if you try access its URL directly (it's not linked anywhere, but someone can type it directly in browser):

https://src.sourcegraph.com/.notifications

(You can open that link in an incognito window to reproduce.)

You get:

template: notifications.html.tmpl:6:29: executing "notifications.html.tmpl" at <.RepoNotifications>: error calling RepoNotifications: permission denied

Instead, it's better for the app to return unauthenticated HTTP status, which will have Sourcegraph redirect you to a login screen. This is the best way to handle resources that require auth when you access them directly and you're not logged in.

Write Preview Markdown
dmitshur commented 10 years ago ยท edited

Fixed in 39752e62.

Write Preview Markdown
dmitshur fixed this 10 years ago
to comment.