Skip to content

Commit

Permalink
Fix deletion of public keys
Browse files Browse the repository at this point in the history
Fixes #194

Signed-off-by: Walker Crouse <walkercrouse@hotmail.com>
  • Loading branch information
windy1 committed Jan 9, 2017
1 parent d1de248 commit 00e02c4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions app/controllers/Users.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import ore.user.{FakeUser, Prompts}
import ore.{OreConfig, OreEnv}
import org.spongepowered.play.mail.Mailer
import org.spongepowered.play.security.SingleSignOnConsumer
import play.Logger
import play.api.i18n.MessagesApi
import play.api.mvc._
import util.EmailFactory
Expand Down Expand Up @@ -91,6 +92,7 @@ class Users @Inject()(fakeUser: FakeUser,
def verify(returnPath: Option[String]) = Authenticated { implicit request =>
val nonce = SingleSignOnConsumer.nonce
this.signOns.add(SignOn(nonce = nonce))
println("returnPath = " + returnPath)
redirectToSso(this.sso.getVerifyUrl(this.baseUrl + returnPath.getOrElse("/"), nonce))
}

Expand Down Expand Up @@ -186,6 +188,7 @@ class Users @Inject()(fakeUser: FakeUser,
*/
def deletePgpPublicKey(username: String, sso: Option[String], sig: Option[String]) = {
VerifiedAction(username, sso, sig) { implicit request =>
Logger.info("Deleting public key for " + username)
val user = request.user
if (user.pgpPubKey.isEmpty)
BadRequest
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := "ore"

version := "1.1.11"
version := "1.1.12"

lazy val `ore` = (project in file(".")).enablePlugins(PlayScala)

Expand Down
4 changes: 2 additions & 2 deletions conf/routes
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ GET / @controllers
GET /signup @controllers.Users.signUp()
GET /login @controllers.Users.logIn(sso: Option[String], sig: Option[String], returnUrl: Option[String])
GET /logout @controllers.Users.logOut(returnUrl: Option[String])
GET /verify @controllers.Users.verify(returnPath: Option[String])
POST /verify @controllers.Users.verify(returnPath: Option[String])

# ---------- Projects ----------

Expand Down Expand Up @@ -83,7 +83,7 @@ GET /:user @controllers
POST /:user/settings/tagline @controllers.Users.saveTagline(user)
POST /:user/settings/lock/:locked @controllers.Users.setLocked(user, locked: Boolean, sso: Option[String], sig: Option[String])
POST /:user/settings/pgp @controllers.Users.savePgpPublicKey(user)
POST /:user/settings/pgp/delete @controllers.Users.deletePgpPublicKey(user, sso: Option[String], sig: Option[String])
GET /:user/settings/pgp/delete @controllers.Users.deletePgpPublicKey(user, sso: Option[String], sig: Option[String])
# -------- End Users --------

POST /:author/:slug @controllers.project.Projects.showFirstVersionCreator(author, slug)
Expand Down

0 comments on commit 00e02c4

Please sign in to comment.