-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[webui] Allow user to generate RSS feed tokens
- Loading branch information
1 parent
3d50a84
commit b6d7f70
Showing
4 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/api/app/controllers/webui/users/rss_tokens_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module Webui | ||
module Users | ||
class RssTokensController < WebuiController | ||
before_action :require_login | ||
|
||
def create | ||
token = User.current.rss_token | ||
if token | ||
flash[:success] = "Successfully re-generated your RSS feed url" | ||
token.regenerate_string | ||
token.save | ||
else | ||
flash[:success] = "Successfully generated your RSS feed url" | ||
User.current.create_rss_token | ||
end | ||
redirect_back(fallback_location: user_notifications_path) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters