oauth2

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Index

Constants

This section is empty.

Variables

View Source
var AuthCallbackRouter = router.Handler(func(c router.Context) {
	provider := c.Param("provider")
	c.ResetRequest(mux.SetURLVars(c.Request(), map[string]string{"provider": provider}))
	gothUser, err := gothic.CompleteUserAuth(c.Writer(), c.Request())

	if err != nil {
		return
	}

	redirectToClient(&c, &gothUser)
})
View Source
var AuthRouter = router.Handler(func(c router.Context) {
	provider := c.Param("provider")

	c.ResetRequest(mux.SetURLVars(c.Request(), map[string]string{"provider": provider}))

	if gothUser, err := gothic.CompleteUserAuth(c.Writer(), c.Request()); err == nil {

		redirectToClient(&c, &gothUser)
	} else {
		gothic.BeginAuthHandler(c.Writer(), c.Request())
	}
})

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL