summaryrefslogtreecommitdiffstats
path: root/modules/context/auth.go
Commit message (Collapse)AuthorAgeFilesLines
* Move install pages out of main macaron routes (#13195)zeripath2020-10-191-6/+0
| | | | | | | | | | | | | * Move install pages out of main macaron loop Signed-off-by: Andrew Thornton <art27@cantab.net> * Update templates/post-install.tmpl Co-authored-by: Lauris BH <lauris@nix.lv> * remove prefetch Signed-off-by: Andrew Thornton <art27@cantab.net>
* Return sample message for login error in api context (#12994)赵智超2020-10-041-3/+23
| | | | | | | | | | | | | | | | | | | | | | * Return sample message for login error in api context Signed-off-by: a1012112796 <1012112796@qq.com> * Update modules/context/auth.go Co-authored-by: silverwind <me@silverwind.io> * Apply suggestions from code review Co-authored-by: Lauris BH <lauris@nix.lv> * Apply suggestions from code review Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Prevent redirect back to /user/events (#12462)zeripath2020-08-081-3/+6
| | | | | | This PR prevents 2 further ways of causing the redirect cookie to be set to redirect back to /user/events Signed-off-by: Andrew Thornton <art27@cantab.net>
* When must change password only show Signout (#11600)zeripath2020-05-261-1/+3
| | | | | | | | | | | | When "Must Change Password" simplify the navbar header to only show the signout button as all other links will redirect back. This prevents the notifications icon from showing preventing initialization of the event-source and hence preventing redirect_to being set, however in addition do not set the redirect_to cookie if we are looking at the /user/events page. Fix #11554 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Use Req.URL.RequestURI() to cope with FCGI urls (#9473)zeripath2019-12-241-4/+4
| | | | | * Use Req.URL.RequestURI() to cope with FCGI urls * Add debug logging statement when forbidden in internal API.
* Use gitea forked macaron (#7933)Tamal Saha2019-08-231-2/+3
| | | Signed-off-by: Tamal Saha <tamal@appscode.com>
* API OTP Context (#6674)techknowlogick2019-04-191-0/+24
| | | | | | | | | | | | | | | | | | | | | | * API OTP Context * Update api.go * token * token * fix per discord * copyright header * remove check for token in OTP * Update auth.go * simplify * Update api.go
* Clean up various use of escape/unescape functions for URL generation (#6334)mrsdizzie2019-03-181-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use PathUnescape instead of QueryUnescape when working with branch names Currently branch names with a '+' fail in certain situations because QueryUnescape replaces the + character with a blank space. Using PathUnescape should be better since it is defined as: // PathUnescape is identical to QueryUnescape except that it does not // unescape '+' to ' ' (space). Fixes #6333 * Change error to match new function name * Add new util function PathEscapeSegments This function simply runs PathEscape on each segment of a path without touching the forward slash itself. We want to use this instead of PathEscape/QueryEscape in most cases because a forward slash is a valid name for a branch etc... and we don't want that escaped in a URL. Putting this in new file url.go and also moving a couple similar functions into that file as well. * Use EscapePathSegments where appropriate Replace various uses of EscapePath/EscapeQuery with new EscapePathSegments. Also remove uncessary uses of various escape/unescape functions when the text had already been escaped or was not escaped. * Reformat comment to make drone build happy * Remove no longer used url library * Requested code changes
* fix display dashboard even if require to change password (#6214)Lunny Xiao2019-02-281-14/+10
| | | | | | * fix display dashboard even if require to change password * fix comments
* Fix prohibit login check on authorization (#6106)Lunny Xiao2019-02-191-2/+7
| | | | | | | | | | | | * fix bug prohibit login not applied on dashboard * fix tests * fix bug user status leak * fix typo * return after render
* modules/context/auth.go: fix redirect loop (#5965)xdch472019-02-171-1/+1
| | | Closes #5815
* Force user to change password (#4489)Lanre Adelowo2018-09-131-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * redirect to login page after successfully activating account * force users to change password if account was created by an admin * force users to change password if account was created by an admin * fixed build * fixed build * fix pending issues with translation and wrong routes * make sure path check is safe * remove unneccessary newline * make sure users that don't have to view the form get redirected * move route to use /settings prefix so as to make sure unauthenticated users can't view the page * update as per @lafriks review * add necessary comment * remove unrelated changes * support redirecting to location the user actually want to go to before being forced to change his/her password * run make fmt * added tests * improve assertions * add assertion * fix copyright year Signed-off-by: Lanre Adelowo <yo@lanre.wtf>
* fix not respecting landing page setting (#4209)David Schneiderbauer2018-06-151-6/+0
| | | | | | | | * fix not respecting landing page setting * fmt * add landing page test
* Golint fixed for modules/setting (#262)Lunny Xiao2016-11-271-8/+8
| | | | | | * golint fixed for modules/setting * typo fixed and renamed UNIXSOCKET to UnixSocket
* Golint fixed for modules/contextLunny Xiao2016-11-251-0/+2
|
* Update import paths from github.com/go-gitea to code.gitea.io (#135)Sandro Santilli2016-11-101-2/+2
| | | | | | | - Update import paths from github.com/go-gitea to code.gitea.io - Fix import path for travis See https://docs.travis-ci.com/user/languages/go#Go-Import-Path
* Fix imports found by goimports.Matthias Loibl2016-11-051-3/+2
|
* Change import reference to match gitea instead of gogs (#37)Rémy Boulanouar2016-11-031-2/+2
|
* Minor naming improvementUnknwon2016-08-171-2/+2
|
* #2937 able to prohibit user loginUnknwon2016-07-161-1/+8
|
* Convert all API handers to use *context.APIContextUnknwon2016-03-131-1/+3
|
* Rename module: middleware -> contextUnknwon2016-03-111-0/+85