mirror of
https://github.com/kataras/iris.git
synced 2025-12-23 12:57:05 +00:00
New feature: Auth support for social networks, dropbox, amazon and so on. Untested
https://github.com/iris-contrib/goth/ is the main package which has been converted to work with Iris from the ... https://github.com/markbates/goth/ . Not yet tested on real application.
This commit is contained in:
16
iris.go
16
iris.go
@@ -59,10 +59,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/kataras/iris/errors"
|
||||
|
||||
"github.com/iris-contrib/goth/gothic"
|
||||
"github.com/kataras/iris/config"
|
||||
"github.com/kataras/iris/context"
|
||||
"github.com/kataras/iris/errors"
|
||||
"github.com/kataras/iris/utils"
|
||||
"github.com/valyala/fasthttp"
|
||||
)
|
||||
@@ -568,6 +568,18 @@ func (s *Framework) TemplateString(templateFile string, pageContext interface{},
|
||||
return res
|
||||
}
|
||||
|
||||
// BeginAuthHandler is a convienence handler for starting the authentication process.
|
||||
// It expects to be able to get the name of the provider from the named parameters
|
||||
// as either "provider" or ":provider".
|
||||
//
|
||||
// BeginAuthHandler will redirect the user to the appropriate authentication end-point
|
||||
// for the requested provider.
|
||||
//
|
||||
// See https://github.com/iris-contrib/goth/examples/main.go to see this in action.
|
||||
func BeginAuthHandler(ctx *Context) {
|
||||
gothic.BeginAuthHandler(ctx)
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------------------
|
||||
// ----------------------------------MuxAPI implementation------------------------------
|
||||
|
||||
Reference in New Issue
Block a user